22from ..exceptions import NotFoundError
33
44class IndicesClient (NamespacedClient ):
5- @query_params ('analyzer' , 'field ' , 'filters ' , 'format ' , 'index ' ,
6- 'prefer_local' , 'text' , 'tokenizer' )
5+ @query_params ('analyzer' , 'char_filters ' , 'field ' , 'filters ' , 'format ' ,
6+ 'index' , ' prefer_local' , 'text' , 'tokenizer' )
77 def analyze (self , index = None , body = None , params = None ):
88 """
99 Perform the analysis process on a text and return the tokens breakdown of the text.
@@ -12,6 +12,8 @@ def analyze(self, index=None, body=None, params=None):
1212 :arg index: The name of the index to scope the operation
1313 :arg body: The text on which the analysis should be performed
1414 :arg analyzer: The name of the analyzer to use
15+ :arg char_filters: A comma-separated list of character filters to use
16+ for the analysis
1517 :arg field: Use the analyzer configured for this field (instead of
1618 passing the analyzer name)
1719 :arg filters: A comma-separated list of filters to use for the analysis
@@ -116,15 +118,23 @@ def open(self, index, params=None):
116118 params = params )
117119 return data
118120
119- @query_params ('timeout' , 'master_timeout' )
121+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
122+ 'master_timeout' , 'timeout' )
120123 def close (self , index , params = None ):
121124 """
122125 Close an index to remove it's overhead from the cluster. Closed index
123126 is blocked for read/write operations.
124127 `<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html>`_
125128
126- :arg index: A comma-separated list of indices to delete; use `_all` or
127- '*' to delete all indices
129+ :arg index: A comma-separated list of indices to close; use `_all` or
130+ '*' to close all indices
131+ :arg allow_no_indices: Whether to ignore if a wildcard indices
132+ expression resolves into no concrete indices. (This includes `_all`
133+ string or when no indices have been specified)
134+ :arg expand_wildcards: Whether to expand wildcard expression to concrete
135+ indices that are open, closed or both., default u'open'
136+ :arg ignore_unavailable: Whether specified concrete indices should be
137+ ignored when unavailable (missing or closed)
128138 :arg master_timeout: Specify timeout for connection to master
129139 :arg timeout: Explicit operation timeout
130140 """
@@ -147,13 +157,21 @@ def delete(self, index, params=None):
147157 params = params )
148158 return data
149159
150- @query_params ('local' )
160+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
161+ 'local' )
151162 def exists (self , index , params = None ):
152163 """
153164 Return a boolean indicating whether given index exists.
154165 `<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-indices-exists.html>`_
155166
156167 :arg index: A list of indices to check
168+ :arg allow_no_indices: Whether to ignore if a wildcard indices
169+ expression resolves into no concrete indices. (This includes `_all`
170+ string or when no indices have been specified)
171+ :arg expand_wildcards: Whether to expand wildcard expression to concrete
172+ indices that are open, closed or both., default u'open'
173+ :arg ignore_unavailable: Whether specified concrete indices should be
174+ ignored when unavailable (missing or closed)
157175 :arg local: Return local information, do not retrieve the state from
158176 master node (default: false)
159177 """
@@ -191,29 +209,8 @@ def exists_type(self, index, doc_type, params=None):
191209 return False
192210 return True
193211
194- @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_indices' , 'ignore_unavailable' )
195- def snapshot_index (self , index = None , params = None ):
196- """
197- Explicitly perform a snapshot through the gateway of one or more indices (backup them).
198- `<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-gateway-snapshot.html>`_
199-
200- :arg index: A comma-separated list of index names; use `_all` or empty
201- string for all indices
202- :arg allow_no_indices: Whether to ignore if a wildcard indices
203- expression resolves into no concrete indices. (This includes `_all` string or
204- when no indices have been specified)
205- :arg expand_wildcards: Whether to expand wildcard expression to concrete indices
206- that are open, closed or both.
207- :arg ignore_indices: When performed on multiple indices, allows to
208- ignore `missing` ones (default: none)
209- :arg ignore_unavailable: Whether specified concrete indices should be ignored
210- when unavailable (missing or closed)
211- """
212- _ , data = self .transport .perform_request ('POST' ,
213- _make_path (index , '_gateway' , 'snapshot' ), params = params )
214- return data
215-
216- @query_params ('ignore_conflicts' , 'timeout' , 'master_timeout' )
212+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_conflicts' ,
213+ 'ignore_unavailable' , 'master_timeout' , 'timeout' )
217214 def put_mapping (self , doc_type , body , index = None , params = None ):
218215 """
219216 Register specific mapping definition for a specific type.
@@ -224,8 +221,15 @@ def put_mapping(self, doc_type, body, index=None, params=None):
224221 operation on all indices.
225222 :arg doc_type: The name of the document type
226223 :arg body: The mapping definition
224+ :arg allow_no_indices: Whether to ignore if a wildcard indices
225+ expression resolves into no concrete indices. (This includes `_all`
226+ string or when no indices have been specified)
227+ :arg expand_wildcards: Whether to expand wildcard expression to concrete
228+ indices that are open, closed or both., default u'open'
227229 :arg ignore_conflicts: Specify whether to ignore conflicts while
228230 updating the mapping (default: false)
231+ :arg ignore_unavailable: Whether specified concrete indices should be
232+ ignored when unavailable (missing or closed)
229233 :arg master_timeout: Specify timeout for connection to master
230234 :arg timeout: Explicit operation timeout
231235 """
@@ -508,35 +512,55 @@ def get_settings(self, index=None, name=None, params=None):
508512 params = params )
509513 return data
510514
511- @query_params ('master_timeout' , 'flat_settings' )
515+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'flat_settings' ,
516+ 'ignore_unavailable' , 'master_timeout' )
512517 def put_settings (self , body , index = None , params = None ):
513518 """
514519 Change specific index level settings in real time.
515520 `<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html>`_
516521
522+ :arg body: The index settings to be updated
517523 :arg index: A comma-separated list of index names; use `_all` or empty
518524 string to perform the operation on all indices
519- :arg master_timeout: Specify timeout for connection to master
520- :arg body: The index settings to be updated
525+ :arg allow_no_indices: Whether to ignore if a wildcard indices
526+ expression resolves into no concrete indices. (This includes `_all`
527+ string or when no indices have been specified)
528+ :arg expand_wildcards: Whether to expand wildcard expression to concrete
529+ indices that are open, closed or both., default u'open'
521530 :arg flat_settings: Return settings in flat format (default: false)
531+ :arg ignore_unavailable: Whether specified concrete indices should be
532+ ignored when unavailable (missing or closed)
533+ :arg master_timeout: Specify timeout for connection to master
522534 """
523535 _ , data = self .transport .perform_request ('PUT' , _make_path (index , '_settings' ),
524536 params = params , body = body )
525537 return data
526538
527- @query_params ('master_timeout' )
539+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
540+ 'master_timeout' )
528541 def put_warmer (self , name , body , index = None , doc_type = None , params = None ):
529542 """
530543 Create an index warmer to run registered search requests to warm up the
531544 index before it is available for search.
532545 `<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html>`_
533546
534- :arg index: A comma-separated list of index names to register the warmer for;
535- use `_all` or empty string to perform the operation on all indices
536547 :arg name: The name of the warmer
548+ :arg body: The search request definition for the warmer (query, filters,
549+ facets, sorting, etc)
550+ :arg index: A comma-separated list of index names to register the warmer
551+ for; use `_all` or omit to perform the operation on all indices
537552 :arg doc_type: A comma-separated list of document types to register the
538553 warmer for; leave empty to perform the operation on all types
539- :arg body: The search request definition for the warmer (query, filters, facets, sorting, etc)
554+ :arg allow_no_indices: Whether to ignore if a wildcard indices
555+ expression resolves into no concrete indices in the search request
556+ to warm. (This includes `_all` string or when no indices have been
557+ specified)
558+ :arg expand_wildcards: Whether to expand wildcard expression to concrete
559+ indices that are open, closed or both, in the search request to
560+ warm., default u'open'
561+ :arg ignore_unavailable: Whether specified concrete indices should be
562+ ignored when unavailable (missing or closed) in the search request
563+ to warm
540564 :arg master_timeout: Specify timeout for connection to master
541565 """
542566 if doc_type and not index :
@@ -545,7 +569,8 @@ def put_warmer(self, name, body, index=None, doc_type=None, params=None):
545569 params = params , body = body )
546570 return data
547571
548- @query_params ('local' )
572+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
573+ 'local' )
549574 def get_warmer (self , index = None , doc_type = None , name = None , params = None ):
550575 """
551576 Retreieve an index warmer.
@@ -555,7 +580,15 @@ def get_warmer(self, index=None, doc_type=None, name=None, params=None):
555580 operation; use `_all` to perform the operation on all indices
556581 :arg doc_type: A comma-separated list of document types to restrict the
557582 operation; leave empty to perform the operation on all types
558- :arg name: The name of the warmer (supports wildcards); leave empty to get all warmers
583+ :arg name: The name of the warmer (supports wildcards); leave empty to
584+ get all warmers
585+ :arg allow_no_indices: Whether to ignore if a wildcard indices
586+ expression resolves into no concrete indices. (This includes `_all`
587+ string or when no indices have been specified)
588+ :arg expand_wildcards: Whether to expand wildcard expression to concrete
589+ indices that are open, closed or both., default u'open'
590+ :arg ignore_unavailable: Whether specified concrete indices should be
591+ ignored when unavailable (missing or closed)
559592 :arg local: Return local information, do not retrieve the state from
560593 master node (default: false)
561594 """
0 commit comments