From 5f18f216bd91542aacb963022ecf97075d616b48 Mon Sep 17 00:00:00 2001 From: Xiaodong Date: Fri, 20 Sep 2019 16:36:09 +0800 Subject: [PATCH] Fix issue caused by breaking change (_source_include/_source_exclude) --- elasticsearch/client/__init__.py | 66 +++++++++++--------------------- 1 file changed, 22 insertions(+), 44 deletions(-) diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index f1399b647..9924133cf 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -366,9 +366,7 @@ def index(self, index, body, doc_type="_doc", id=None, params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "parent", "preference", @@ -388,9 +386,9 @@ def exists(self, index, id, doc_type="_doc", params=None): :arg id: The document ID :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg parent: The ID of the parent document :arg preference: Specify the node or shard the operation should be @@ -415,9 +413,7 @@ def exists(self, index, id, doc_type="_doc", params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "parent", "preference", @@ -435,9 +431,9 @@ def exists_source(self, index, id, doc_type=None, params=None): :arg id: The document ID :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg parent: The ID of the parent document :arg preference: Specify the node or shard the operation should be @@ -460,9 +456,7 @@ def exists_source(self, index, id, doc_type=None, params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "parent", "preference", @@ -482,9 +476,9 @@ def get(self, index, id, doc_type="_doc", params=None): :arg id: The document ID :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg parent: The ID of the parent document :arg preference: Specify the node or shard the operation should be @@ -509,9 +503,7 @@ def get(self, index, id, doc_type="_doc", params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "parent", "preference", @@ -530,9 +522,9 @@ def get_source(self, index, id, doc_type="_doc", params=None): :arg id: The document ID :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg parent: The ID of the parent document :arg preference: Specify the node or shard the operation should be @@ -555,9 +547,7 @@ def get_source(self, index, id, doc_type="_doc", params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "preference", "realtime", @@ -576,9 +566,9 @@ def mget(self, body, doc_type=None, index=None, params=None): :arg index: The name of the index :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg preference: Specify the node or shard the operation should be performed on (default: random) @@ -598,9 +588,7 @@ def mget(self, body, doc_type=None, index=None, params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "fields", "if_seq_no", @@ -627,9 +615,9 @@ def update(self, index, id, doc_type="_doc", body=None, params=None): :arg body: The request definition using either `script` or partial `doc` :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg fields: A comma-separated list of fields to return in the response :arg if_seq_no: @@ -666,9 +654,7 @@ def update(self, index, id, doc_type="_doc", body=None, params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "allow_no_indices", "allow_partial_search_results", @@ -721,9 +707,9 @@ def search(self, index=None, body=None, params=None): :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` @@ -821,9 +807,7 @@ def search(self, index=None, body=None, params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "allow_no_indices", "analyze_wildcard", @@ -868,9 +852,9 @@ def update_by_query(self, index, body=None, params=None): :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` @@ -1015,9 +999,7 @@ def reindex_rethrottle(self, task_id=None, params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "allow_no_indices", "analyze_wildcard", @@ -1060,9 +1042,9 @@ def delete_by_query(self, index, body, params=None): :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` @@ -1242,9 +1224,7 @@ def search_template(self, index=None, body=None, params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "analyze_wildcard", "analyzer", @@ -1269,9 +1249,9 @@ def explain(self, index, id, doc_type="_doc", body=None, params=None): :arg body: The query definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return - :arg _source_exclude: A list of fields to exclude from the returned + :arg _source_excludes: A list of fields to exclude from the returned _source field - :arg _source_include: A list of fields to extract and return from the + :arg _source_includes: A list of fields to extract and return from the _source field :arg analyze_wildcard: Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) @@ -1450,9 +1430,7 @@ def count(self, doc_type=None, index=None, body=None, params=None): @query_params( "_source", - "_source_exclude", "_source_excludes", - "_source_include", "_source_includes", "fields", "pipeline", @@ -1475,9 +1453,9 @@ def bulk(self, body, doc_type=None, index=None, params=None): :arg _source: True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub- request - :arg _source_exclude: Default list of fields to exclude from the + :arg _source_excludes: Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - :arg _source_include: Default list of fields to extract and return from + :arg _source_includes: Default list of fields to extract and return from the _source field, can be overridden on each sub-request :arg fields: Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request