11from .utils import NamespacedClient , query_params , _make_path , SKIP_IN_PATH
22
33class IndicesClient (NamespacedClient ):
4- @query_params ('analyzer' , 'attributes' , 'char_filter' , 'explain' , 'field' ,
5- 'filter' , 'format' , 'prefer_local' , 'text' , 'tokenizer' )
4+ @query_params ('format' , 'prefer_local' )
65 def analyze (self , index = None , body = None , params = None ):
76 """
87 Perform the analysis process on a text and return the tokens breakdown of the text.
98 `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html>`_
109
1110 :arg index: The name of the index to scope the operation
12- :arg body: The text on which the analysis should be performed
13- :arg analyzer: The name of the analyzer to use
14- :arg attributes: A comma-separated list of token attributes to output,
15- this parameter works only with `explain=true`
16- :arg char_filter: A comma-separated list of character filters to use for
17- the analysis
18- :arg explain: With `true`, outputs more advanced details. (default:
19- false)
20- :arg field: Use the analyzer configured for this field (instead of
21- passing the analyzer name)
22- :arg filter: A comma-separated list of filters to use for the analysis
11+ :arg body: Define analyzer/tokenizer parameters and the text on which
12+ the analysis should be performed
2313 :arg format: Format of the output, default 'detailed', valid choices
2414 are: 'detailed', 'text'
2515 :arg prefer_local: With `true`, specify that a local shard should be
2616 used if available, with `false`, use a random shard (default: true)
27- :arg text: The text on which the analysis should be performed (when
28- request body is not used)
29- :arg tokenizer: The name of the tokenizer to use for the analysis
3017 """
3118 return self .transport .perform_request ('GET' , _make_path (index ,
3219 '_analyze' ), params = params , body = body )
3320
34- @query_params ('allow_no_indices' , 'expand_wildcards' , 'force' ,
35- 'ignore_unavailable' , 'operation_threading' )
21+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' )
3622 def refresh (self , index = None , params = None ):
3723 """
3824 Explicitly refresh one or more index, making all operations performed
@@ -47,10 +33,8 @@ def refresh(self, index=None, params=None):
4733 :arg expand_wildcards: Whether to expand wildcard expression to concrete
4834 indices that are open, closed or both., default 'open', valid
4935 choices are: 'open', 'closed', 'none', 'all'
50- :arg force: Force a refresh even if not required, default False
5136 :arg ignore_unavailable: Whether specified concrete indices should be
5237 ignored when unavailable (missing or closed)
53- :arg operation_threading: TODO: ?
5438 """
5539 return self .transport .perform_request ('POST' , _make_path (index ,
5640 '_refresh' ), params = params )
@@ -107,22 +91,19 @@ def create(self, index, body=None, params=None):
10791 params = params , body = body )
10892
10993 @query_params ('allow_no_indices' , 'expand_wildcards' , 'flat_settings' ,
110- 'human' , ' ignore_unavailable' , 'include_defaults' , 'local' )
94+ 'ignore_unavailable' , 'include_defaults' , 'local' )
11195 def get (self , index , feature = None , params = None ):
11296 """
11397 The get index API allows to retrieve information about one or more indexes.
11498 `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html>`_
11599
116100 :arg index: A comma-separated list of index names
117- :arg feature: A comma-separated list of features
118101 :arg allow_no_indices: Ignore if a wildcard expression resolves to no
119102 concrete indices (default: false)
120103 :arg expand_wildcards: Whether wildcard expressions should get expanded
121104 to open or closed indices (default: open), default 'open', valid
122105 choices are: 'open', 'closed', 'none', 'all'
123106 :arg flat_settings: Return settings in flat format (default: false)
124- :arg human: Whether to return version and creation date values in human-
125- readable format., default False
126107 :arg ignore_unavailable: Ignore unavailable indexes (default: false)
127108 :arg include_defaults: Whether to return all default setting for each of
128109 the indices., default False
@@ -183,14 +164,21 @@ def close(self, index, params=None):
183164 return self .transport .perform_request ('POST' , _make_path (index ,
184165 '_close' ), params = params )
185166
186- @query_params ('master_timeout' , 'timeout' )
167+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
168+ 'master_timeout' , 'timeout' )
187169 def delete (self , index , params = None ):
188170 """
189171 Delete an index in Elasticsearch
190172 `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html>`_
191173
192174 :arg index: A comma-separated list of indices to delete; use `_all` or
193175 `*` string to delete all indices
176+ :arg allow_no_indices: Ignore if a wildcard expression resolves to no
177+ concrete indices (default: false)
178+ :arg expand_wildcards: Whether wildcard expressions should get expanded
179+ to open or closed indices (default: open), default 'open', valid
180+ choices are: 'open', 'closed', 'none', 'all'
181+ :arg ignore_unavailable: Ignore unavailable indexes (default: false)
194182 :arg master_timeout: Specify timeout for connection to master
195183 :arg timeout: Explicit operation timeout
196184 """
@@ -199,22 +187,23 @@ def delete(self, index, params=None):
199187 return self .transport .perform_request ('DELETE' , _make_path (index ),
200188 params = params )
201189
202- @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable ' ,
203- 'local' )
190+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'flat_settings ' ,
191+ 'ignore_unavailable' , 'include_defaults' , ' local' )
204192 def exists (self , index , params = None ):
205193 """
206194 Return a boolean indicating whether given index exists.
207195 `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html>`_
208196
209- :arg index: A comma-separated list of indices to check
210- :arg allow_no_indices: Whether to ignore if a wildcard indices
211- expression resolves into no concrete indices. (This includes `_all`
212- string or when no indices have been specified)
213- :arg expand_wildcards: Whether to expand wildcard expression to concrete
214- indices that are open, closed or both., default 'open', valid
197+ :arg index: A comma-separated list of index names
198+ :arg allow_no_indices: Ignore if a wildcard expression resolves to no
199+ concrete indices (default: false)
200+ :arg expand_wildcards: Whether wildcard expressions should get expanded
201+ to open or closed indices (default: open), default 'open', valid
215202 choices are: 'open', 'closed', 'none', 'all'
216- :arg ignore_unavailable: Whether specified concrete indices should be
217- ignored when unavailable (missing or closed)
203+ :arg flat_settings: Return settings in flat format (default: false)
204+ :arg ignore_unavailable: Ignore unavailable indexes (default: false)
205+ :arg include_defaults: Whether to return all default setting for each of
206+ the indices., default False
218207 :arg local: Return local information, do not retrieve the state from
219208 master node (default: false)
220209 """
@@ -365,8 +354,8 @@ def exists_alias(self, index=None, name=None, params=None):
365354 expression resolves into no concrete indices. (This includes `_all`
366355 string or when no indices have been specified)
367356 :arg expand_wildcards: Whether to expand wildcard expression to concrete
368- indices that are open, closed or both., default ['open ', 'closed'],
369- valid choices are: 'open', 'closed', 'none', 'all'
357+ indices that are open, closed or both., default 'all ', valid choices
358+ are: 'open', 'closed', 'none', 'all'
370359 :arg ignore_unavailable: Whether specified concrete indices should be
371360 ignored when unavailable (missing or closed)
372361 :arg local: Return local information, do not retrieve the state from
@@ -388,8 +377,8 @@ def get_alias(self, index=None, name=None, params=None):
388377 expression resolves into no concrete indices. (This includes `_all`
389378 string or when no indices have been specified)
390379 :arg expand_wildcards: Whether to expand wildcard expression to concrete
391- indices that are open, closed or both., default 'all', valid
392- choices are: 'open', 'closed', 'none', 'all'
380+ indices that are open, closed or both., default 'all', valid choices
381+ are: 'open', 'closed', 'none', 'all'
393382 :arg ignore_unavailable: Whether specified concrete indices should be
394383 ignored when unavailable (missing or closed)
395384 :arg local: Return local information, do not retrieve the state from
@@ -457,13 +446,14 @@ def put_template(self, name, body, params=None):
457446 return self .transport .perform_request ('PUT' , _make_path ('_template' ,
458447 name ), params = params , body = body )
459448
460- @query_params ('local' , 'master_timeout' )
449+ @query_params ('flat_settings' , ' local' , 'master_timeout' )
461450 def exists_template (self , name , params = None ):
462451 """
463452 Return a boolean indicating whether given template exists.
464453 `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_
465454
466- :arg name: The name of the template
455+ :arg name: The comma separated names of the index templates
456+ :arg flat_settings: Return settings in flat format (default: false)
467457 :arg local: Return local information, do not retrieve the state from
468458 master node (default: false)
469459 :arg master_timeout: Explicit operation timeout for connection to master
@@ -506,7 +496,7 @@ def delete_template(self, name, params=None):
506496 _make_path ('_template' , name ), params = params )
507497
508498 @query_params ('allow_no_indices' , 'expand_wildcards' , 'flat_settings' ,
509- 'human' , ' ignore_unavailable' , 'include_defaults' , 'local' )
499+ 'ignore_unavailable' , 'include_defaults' , 'local' )
510500 def get_settings (self , index = None , name = None , params = None ):
511501 """
512502 Retrieve settings for one or more (or all) indices.
@@ -522,8 +512,6 @@ def get_settings(self, index=None, name=None, params=None):
522512 indices that are open, closed or both., default ['open', 'closed'],
523513 valid choices are: 'open', 'closed', 'none', 'all'
524514 :arg flat_settings: Return settings in flat format (default: false)
525- :arg human: Whether to return version and creation date values in human-
526- readable format., default False
527515 :arg ignore_unavailable: Whether specified concrete indices should be
528516 ignored when unavailable (missing or closed)
529517 :arg include_defaults: Whether to return all default setting for each of
@@ -615,10 +603,9 @@ def segments(self, index=None, params=None):
615603 return self .transport .perform_request ('GET' , _make_path (index ,
616604 '_segments' ), params = params )
617605
618- @query_params ('allow_no_indices' , 'analyze_wildcard' , 'analyzer' ,
619- 'default_operator' , 'df' , 'expand_wildcards' , 'explain' ,
620- 'ignore_unavailable' , 'lenient' , 'lowercase_expanded_terms' ,
621- 'operation_threading' , 'q' , 'rewrite' )
606+ @query_params ('all_shards' , 'allow_no_indices' , 'analyze_wildcard' ,
607+ 'analyzer' , 'default_operator' , 'df' , 'expand_wildcards' , 'explain' ,
608+ 'ignore_unavailable' , 'lenient' , 'operation_threading' , 'q' , 'rewrite' )
622609 def validate_query (self , index = None , doc_type = None , body = None , params = None ):
623610 """
624611 Validate a potentially expensive query without executing it.
@@ -630,6 +617,8 @@ def validate_query(self, index=None, doc_type=None, body=None, params=None):
630617 :arg doc_type: A comma-separated list of document types to restrict the
631618 operation; leave empty to perform the operation on all types
632619 :arg body: The query definition specified with the Query DSL
620+ :arg all_shards: Execute validation on all shards instead of one random
621+ shard per index
633622 :arg allow_no_indices: Whether to ignore if a wildcard indices
634623 expression resolves into no concrete indices. (This includes `_all`
635624 string or when no indices have been specified)
@@ -648,8 +637,6 @@ def validate_query(self, index=None, doc_type=None, body=None, params=None):
648637 ignored when unavailable (missing or closed)
649638 :arg lenient: Specify whether format-based query failures (such as
650639 providing text to a numeric field) should be ignored
651- :arg lowercase_expanded_terms: Specify whether query terms should be
652- lowercased
653640 :arg operation_threading: TODO: ?
654641 :arg q: Query in the Lucene query string syntax
655642 :arg rewrite: Provide a more detailed explanation showing the actual
@@ -682,6 +669,7 @@ def clear_cache(self, index=None, params=None):
682669 :arg query: Clear query caches
683670 :arg recycler: Clear the recycler cache
684671 :arg request: Clear request cache
672+ :arg request_cache: Clear request cache
685673 """
686674 return self .transport .perform_request ('POST' , _make_path (index ,
687675 '_cache' , 'clear' ), params = params )
0 commit comments