2
2
from ..exceptions import NotFoundError
3
3
4
4
class 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' )
7
7
def analyze (self , index = None , body = None , params = None ):
8
8
"""
9
9
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):
12
12
:arg index: The name of the index to scope the operation
13
13
:arg body: The text on which the analysis should be performed
14
14
: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
15
17
:arg field: Use the analyzer configured for this field (instead of
16
18
passing the analyzer name)
17
19
:arg filters: A comma-separated list of filters to use for the analysis
@@ -116,15 +118,23 @@ def open(self, index, params=None):
116
118
params = params )
117
119
return data
118
120
119
- @query_params ('timeout' , 'master_timeout' )
121
+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
122
+ 'master_timeout' , 'timeout' )
120
123
def close (self , index , params = None ):
121
124
"""
122
125
Close an index to remove it's overhead from the cluster. Closed index
123
126
is blocked for read/write operations.
124
127
`<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html>`_
125
128
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)
128
138
:arg master_timeout: Specify timeout for connection to master
129
139
:arg timeout: Explicit operation timeout
130
140
"""
@@ -147,13 +157,21 @@ def delete(self, index, params=None):
147
157
params = params )
148
158
return data
149
159
150
- @query_params ('local' )
160
+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
161
+ 'local' )
151
162
def exists (self , index , params = None ):
152
163
"""
153
164
Return a boolean indicating whether given index exists.
154
165
`<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-indices-exists.html>`_
155
166
156
167
: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)
157
175
:arg local: Return local information, do not retrieve the state from
158
176
master node (default: false)
159
177
"""
@@ -191,29 +209,8 @@ def exists_type(self, index, doc_type, params=None):
191
209
return False
192
210
return True
193
211
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' )
217
214
def put_mapping (self , doc_type , body , index = None , params = None ):
218
215
"""
219
216
Register specific mapping definition for a specific type.
@@ -224,8 +221,15 @@ def put_mapping(self, doc_type, body, index=None, params=None):
224
221
operation on all indices.
225
222
:arg doc_type: The name of the document type
226
223
: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'
227
229
:arg ignore_conflicts: Specify whether to ignore conflicts while
228
230
updating the mapping (default: false)
231
+ :arg ignore_unavailable: Whether specified concrete indices should be
232
+ ignored when unavailable (missing or closed)
229
233
:arg master_timeout: Specify timeout for connection to master
230
234
:arg timeout: Explicit operation timeout
231
235
"""
@@ -508,35 +512,55 @@ def get_settings(self, index=None, name=None, params=None):
508
512
params = params )
509
513
return data
510
514
511
- @query_params ('master_timeout' , 'flat_settings' )
515
+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'flat_settings' ,
516
+ 'ignore_unavailable' , 'master_timeout' )
512
517
def put_settings (self , body , index = None , params = None ):
513
518
"""
514
519
Change specific index level settings in real time.
515
520
`<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html>`_
516
521
522
+ :arg body: The index settings to be updated
517
523
:arg index: A comma-separated list of index names; use `_all` or empty
518
524
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'
521
530
: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
522
534
"""
523
535
_ , data = self .transport .perform_request ('PUT' , _make_path (index , '_settings' ),
524
536
params = params , body = body )
525
537
return data
526
538
527
- @query_params ('master_timeout' )
539
+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
540
+ 'master_timeout' )
528
541
def put_warmer (self , name , body , index = None , doc_type = None , params = None ):
529
542
"""
530
543
Create an index warmer to run registered search requests to warm up the
531
544
index before it is available for search.
532
545
`<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-warmers.html>`_
533
546
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
536
547
: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
537
552
:arg doc_type: A comma-separated list of document types to register the
538
553
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
540
564
:arg master_timeout: Specify timeout for connection to master
541
565
"""
542
566
if doc_type and not index :
@@ -545,7 +569,8 @@ def put_warmer(self, name, body, index=None, doc_type=None, params=None):
545
569
params = params , body = body )
546
570
return data
547
571
548
- @query_params ('local' )
572
+ @query_params ('allow_no_indices' , 'expand_wildcards' , 'ignore_unavailable' ,
573
+ 'local' )
549
574
def get_warmer (self , index = None , doc_type = None , name = None , params = None ):
550
575
"""
551
576
Retreieve an index warmer.
@@ -555,7 +580,15 @@ def get_warmer(self, index=None, doc_type=None, name=None, params=None):
555
580
operation; use `_all` to perform the operation on all indices
556
581
:arg doc_type: A comma-separated list of document types to restrict the
557
582
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)
559
592
:arg local: Return local information, do not retrieve the state from
560
593
master node (default: false)
561
594
"""
0 commit comments