Skip to content

Commit 3f2b1b9

Browse files
dmvassfxdgear
authored andcommitted
Add support for allow_partial_search_results search request parameter (elastic#821)
1 parent dfd9e8d commit 3f2b1b9

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

elasticsearch/client/__init__.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -547,14 +547,15 @@ def update(self, index, doc_type, id, body=None, params=None):
547547
doc_type, id, '_update'), params=params, body=body)
548548

549549
@query_params('_source', '_source_exclude', '_source_include',
550-
'allow_no_indices', 'analyze_wildcard', 'analyzer',
551-
'batched_reduce_size', 'default_operator', 'df', 'docvalue_fields',
552-
'expand_wildcards', 'explain', 'from_', 'ignore_unavailable', 'lenient',
553-
'max_concurrent_shard_requests', 'pre_filter_shard_size', 'preference',
554-
'q', 'request_cache', 'routing', 'scroll', 'search_type', 'size',
555-
'sort', 'stats', 'stored_fields', 'suggest_field', 'suggest_mode',
556-
'suggest_size', 'suggest_text', 'terminate_after', 'timeout',
557-
'track_scores', 'track_total_hits', 'typed_keys', 'version')
550+
'allow_no_indices', 'allow_partial_search_results', 'analyze_wildcard',
551+
'analyzer', 'batched_reduce_size', 'default_operator', 'df',
552+
'docvalue_fields', 'expand_wildcards', 'explain', 'from_',
553+
'ignore_unavailable', 'lenient', 'max_concurrent_shard_requests',
554+
'pre_filter_shard_size', 'preference', 'q', 'request_cache', 'routing',
555+
'scroll', 'search_type', 'size', 'sort', 'stats', 'stored_fields',
556+
'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text',
557+
'terminate_after', 'timeout', 'track_scores', 'track_total_hits',
558+
'typed_keys', 'version')
558559
def search(self, index=None, doc_type=None, body=None, params=None):
559560
"""
560561
Execute a search query and get back search hits that match the query.
@@ -574,6 +575,10 @@ def search(self, index=None, doc_type=None, body=None, params=None):
574575
:arg allow_no_indices: Whether to ignore if a wildcard indices
575576
expression resolves into no concrete indices. (This includes `_all`
576577
string or when no indices have been specified)
578+
:arg allow_partial_search_results: Set to false to return an overall
579+
failure if the request would produce partial results. Defaults to
580+
True, which will allow partial results in the case of timeouts or
581+
partial failures
577582
:arg analyze_wildcard: Specify whether wildcard and prefix queries
578583
should be analyzed (default: false)
579584
:arg analyzer: The analyzer to use for the query string

0 commit comments

Comments
 (0)