Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions elasticsearch/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ def update(self, index, doc_type, id, body=None, params=None):

@query_params('_source', '_source_exclude', '_source_include',
'analyze_wildcard', 'analyzer', 'default_operator', 'df',
'explain', 'fields', 'ignore_indices', 'indices_boost', 'lenient',
'explain', 'fields', 'indices_boost', 'lenient',
'allow_no_indices', 'expand_wildcards', 'ignore_unavailable',
'lowercase_expanded_terms', 'from_', 'preference', 'q', 'routing',
'scroll', 'search_type', 'size', 'sort', 'source', 'stats',
'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout',
Expand Down Expand Up @@ -394,11 +395,16 @@ def search(self, index=None, doc_type=None, body=None, params=None):
:arg explain: Specify whether to return detailed information about
score computation as part of a hit
:arg fields: A comma-separated list of fields to return as part of a hit
:arg ignore_indices: When performed on multiple indices, allows to
ignore `missing` ones (default: none)
:arg indices_boost: Comma-separated list of index boosts
:arg lenient: Specify whether format-based query failures (such as
providing text to a numeric field) should be ignored
:arg allow_no_indices: Whether to ignore if a wildcard indices
expression resolves into no concrete indices. (This includes `_all`
string or when no indices have been specified)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg lowercase_expanded_terms: Specify whether query terms should be lowercased
:arg from_: Starting offset (default: 0)
:arg preference: Specify the node or shard the operation should be
Expand Down Expand Up @@ -523,7 +529,7 @@ def delete(self, index, doc_type, id, params=None):
_, data = self.transport.perform_request('DELETE', _make_path(index, doc_type, id), params=params)
return data

@query_params('ignore_indices', 'min_score', 'preference', 'q', 'routing', 'source')
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'min_score', 'preference', 'q', 'routing', 'source')
def count(self, index=None, doc_type=None, body=None, params=None):
"""
Execute a query and get the number of matches for that query.
Expand All @@ -532,8 +538,13 @@ def count(self, index=None, doc_type=None, body=None, params=None):
:arg index: A comma-separated list of indices to restrict the results
:arg doc_type: A comma-separated list of types to restrict the results
:arg body: A query to restrict the results (optional)
:arg ignore_indices: When performed on multiple indices, allows to
ignore `missing` ones (default: none)
:arg allow_no_indices: Whether to ignore if a wildcard indices
expression resolves into no concrete indices. (This includes `_all`
string or when no indices have been specified)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg min_score: Include only documents with a specific `_score` value in the result
:arg preference: Specify the node or shard the operation should be
performed on (default: random)
Expand Down Expand Up @@ -586,7 +597,7 @@ def msearch(self, body, index=None, doc_type=None, params=None):
params=params, body=self._bulk_body(body))
return data

@query_params('consistency', 'ignore_indices', 'replication', 'routing', 'source', 'timeout', 'q')
@query_params('consistency', 'allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'replication', 'routing', 'source', 'timeout', 'q')
def delete_by_query(self, index, doc_type=None, body=None, params=None):
"""
Delete documents from one or more indices and one or more types based on a query.
Expand All @@ -596,8 +607,13 @@ def delete_by_query(self, index, doc_type=None, body=None, params=None):
:arg doc_type: A comma-separated list of types to restrict the operation
:arg body: A query to restrict the operation
:arg consistency: Specific write consistency setting for the operation
:arg ignore_indices: When performed on multiple indices, allows to
ignore `missing` ones (default: none)
:arg allow_no_indices: Whether to ignore if a wildcard indices
expression resolves into no concrete indices. (This includes `_all`
string or when no indices have been specified)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg replication: Specific replication type (default: sync)
:arg routing: Specific routing value
:arg source: The URL-encoded query definition (instead of using the request body)
Expand All @@ -608,7 +624,7 @@ def delete_by_query(self, index, doc_type=None, body=None, params=None):
params=params, body=body)
return data

@query_params('ignore_indices', 'preference', 'routing', 'source')
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'preference', 'routing', 'source')
def suggest(self, body, index=None, params=None):
"""
The suggest feature suggests similar looking terms based on a provided
Expand All @@ -618,8 +634,13 @@ def suggest(self, body, index=None, params=None):
:arg index: A comma-separated list of index names to restrict the operation;
use `_all` or empty string to perform the operation on all indices
:arg body: The request definition
:arg ignore_indices: When performed on multiple indices, allows to
ignore `missing` ones (default: none)
:arg allow_no_indices: Whether to ignore if a wildcard indices
expression resolves into no concrete indices. (This includes `_all`
string or when no indices have been specified)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg preference: Specify the node or shard the operation should be
performed on (default: random)
:arg routing: Specific routing value
Expand Down