diff --git a/elasticsearch_docs.py b/elasticsearch_docs.py index fbd5b96..b906064 100644 --- a/elasticsearch_docs.py +++ b/elasticsearch_docs.py @@ -7,7 +7,6 @@ from .elasticsearch import ReusltJsonCommand from .elasticsearch import make_path -from .elasticsearch import DEFAULT_PARAMS class ElasticsearchDeleteDocumentCommand(ReusltJsonCommand): @@ -25,7 +24,7 @@ def on_done(self, document_id): return path = make_path(self.index, self.doc_type, document_id) - self.request_delete(path, params=DEFAULT_PARAMS) + self.request_delete(path) class ElasticsearchGetDocumentCommand(ReusltJsonCommand): @@ -39,7 +38,7 @@ def on_done(self, document_id): return path = make_path(self.index, self.doc_type, document_id) - self.request_get(path, params=DEFAULT_PARAMS) + self.request_get(path) class ElasticsearchIndexDocumentCommand(ReusltJsonCommand): @@ -52,9 +51,9 @@ def on_done(self, document_id): path = make_path(self.index, self.doc_type, document_id) body = self.get_selection() if document_id: - self.request_put(path, body=body, params=DEFAULT_PARAMS) + self.request_put(path, body=body) else: - self.request_post(path, body=body, params=DEFAULT_PARAMS) + self.request_post(path, body=body) class ElasticsearchUpdateDocumentCommand(ReusltJsonCommand): @@ -68,4 +67,4 @@ def on_done(self, document_id): return path = make_path(self.index, self.doc_type, document_id, '_update') body = self.get_selection() - self.request_post(path, body=body, params=DEFAULT_PARAMS) + self.request_post(path, body=body) diff --git a/elasticsearch_indices.py b/elasticsearch_indices.py index 8bcacc8..c9faafc 100644 --- a/elasticsearch_indices.py +++ b/elasticsearch_indices.py @@ -6,7 +6,6 @@ """ from .elasticsearch import ReusltJsonCommand from .elasticsearch import make_path -from .elasticsearch import DEFAULT_PARAMS class ElasticsearchAnalyzeCommand(ReusltJsonCommand): @@ -29,7 +28,7 @@ def run(self, request_body=False): self.request_body = request_body path = make_path(self.index) body = self.request_body and self.get_selection() or None - self.request_put(path, body=body, params=DEFAULT_PARAMS) + self.request_put(path, body=body) class ElasticsearchDeleteIndexCommand(ReusltJsonCommand): @@ -41,7 +40,7 @@ def run(self): return path = make_path(self.index) - self.request_delete(path, params=DEFAULT_PARAMS) + self.request_delete(path) class ElasticsearchDeleteMappingCommand(ReusltJsonCommand): @@ -53,7 +52,7 @@ def run(self): return path = make_path(self.index, self.doc_type) - self.request_delete(path, params=DEFAULT_PARAMS) + self.request_delete(path) class ElasticsearchGetSettingsCommand(ReusltJsonCommand): @@ -61,7 +60,7 @@ class ElasticsearchGetSettingsCommand(ReusltJsonCommand): def run(self): path = make_path(self.index, '_settings') - self.request_get(path, params=DEFAULT_PARAMS) + self.request_get(path) class ElasticsearchGetMappingCommand(ReusltJsonCommand): @@ -69,7 +68,7 @@ class ElasticsearchGetMappingCommand(ReusltJsonCommand): def run(self): path = make_path(self.index, '_mapping', self.doc_type) - self.request_get(path, params=DEFAULT_PARAMS) + self.request_get(path) class ElasticsearchPutMappingCommand(ReusltJsonCommand): @@ -78,7 +77,7 @@ class ElasticsearchPutMappingCommand(ReusltJsonCommand): def run(self): path = make_path(self.index, '_mapping', self.doc_type) body = self.get_selection() - self.request_put(path, body=body, params=DEFAULT_PARAMS) + self.request_put(path, body=body) class ElasticsearchPutWarmerCommand(ReusltJsonCommand): @@ -92,7 +91,7 @@ def on_done(self, name): return path = make_path(self.index, '_warmer', name) body = self.get_selection() - self.request_put(path, body=body, params=DEFAULT_PARAMS) + self.request_put(path, body=body) class ElasticsearchDeleteWarmerCommand(ReusltJsonCommand): @@ -110,7 +109,7 @@ def on_done(self, warmer): return path = make_path(self.index, '_warmer', warmer) - self.request_delete(path, params=DEFAULT_PARAMS) + self.request_delete(path) class ElasticsearchGetWarmerCommand(ReusltJsonCommand): @@ -121,7 +120,7 @@ def run(self): def on_done(self, name): path = make_path(self.index, '_warmer', name) - self.request_get(path, params=DEFAULT_PARAMS) + self.request_get(path) class ElasticsearchAddAliasCommand(ReusltJsonCommand): @@ -134,7 +133,7 @@ def run(self, request_body=False): def on_done(self, alias): path = make_path(self.index, '_alias', alias) body = self.request_body and self.get_selection() or None - self.request_put(path, body=body, params=DEFAULT_PARAMS) + self.request_put(path, body=body) class ElasticsearchDeleteAliasCommand(ReusltJsonCommand): @@ -152,7 +151,7 @@ def on_done(self, alias): return path = make_path(self.index, '_alias', alias) - self.request_delete(path, params=DEFAULT_PARAMS) + self.request_delete(path) class ElasticsearchGetAliasCommand(ReusltJsonCommand): @@ -163,4 +162,4 @@ def run(self): def on_done(self, alias): path = make_path(self.index, '_alias', alias) - self.request_get(path, params=DEFAULT_PARAMS) + self.request_get(path) diff --git a/elasticsearch_search.py b/elasticsearch_search.py index c021098..a9d72be 100644 --- a/elasticsearch_search.py +++ b/elasticsearch_search.py @@ -9,7 +9,6 @@ from .elasticsearch import make_path from .elasticsearch import make_choices from .elasticsearch import choice -from .elasticsearch import DEFAULT_PARAMS SEARCH_TYPE_CHOICES = ( ('query_then_fetch', 'Search Type: Query Then Fetch (default)'), @@ -76,7 +75,7 @@ class ElasticsearchBenchmarkCommand(ReusltJsonCommand): def run(self): path = make_path('_bench') body = self.get_selection() - self.request_put(path, body=body, params=DEFAULT_PARAMS) + self.request_put(path, body=body) class ElasticsearchDeletePercolatorCommand(ReusltJsonCommand): @@ -94,7 +93,7 @@ def on_done(self, document_id): return path = make_path(self.index, '.percolator', document_id) - self.request_delete(path, params=DEFAULT_PARAMS) + self.request_delete(path) class ElasticsearchExplainDocumentCommand(ReusltJsonCommand): @@ -108,7 +107,7 @@ def on_done(self, document_id): return path = make_path(self.index, self.doc_type, document_id, '_explain') body = self.get_selection() - self.request_post(path, body=body, params=DEFAULT_PARAMS) + self.request_post(path, body=body) class ElasticsearchMatchPercolatorCommand(ReusltJsonCommand): @@ -117,7 +116,7 @@ class ElasticsearchMatchPercolatorCommand(ReusltJsonCommand): def run(self): path = make_path(self.index, self.doc_type, '_percolate') body = self.get_selection() - self.request_post(path, body=body, params=DEFAULT_PARAMS) + self.request_post(path, body=body) class ElasticsearchRegisterPercolatorCommand(ReusltJsonCommand): @@ -131,7 +130,7 @@ def on_done(self, document_id): return path = make_path(self.index, '.percolator', document_id) body = self.get_selection() - self.request_put(path, body=body, params=DEFAULT_PARAMS) + self.request_put(path, body=body) class ElasticsearchShowPercolatorCommand(ReusltJsonCommand): @@ -139,7 +138,7 @@ class ElasticsearchShowPercolatorCommand(ReusltJsonCommand): def run(self): path = make_path(self.index, '.percolator', '_search') - self.request_get(path, params=DEFAULT_PARAMS) + self.request_get(path) class ElasticsearchValidateQueryCommand(ReusltJsonCommand): @@ -164,7 +163,7 @@ def on_done(self, template): path = make_path('_search', 'template', template) body = self.get_selection() - self.request_post(path, body=body, params=DEFAULT_PARAMS) + self.request_post(path, body=body) class ElasticsearchDeleteSearchTemplateCommand(ReusltJsonCommand): @@ -182,7 +181,7 @@ def on_done(self, template): return path = make_path('_search', 'template', template) - self.request_delete(path, body=None, params=DEFAULT_PARAMS) + self.request_delete(path, body=None) class ElasticsearchGetSearchTemplateCommand(ReusltJsonCommand): @@ -194,7 +193,7 @@ def run(self): def on_done(self, template): if template: path = make_path('_search', 'template', template) - params = DEFAULT_PARAMS + params = None else: path = make_path('.scripts', '_search') params = dict(_source='false')