From ee4a37658f77f6dfc3770256cc9a5f4f2d95a3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Tue, 25 Nov 2014 13:48:23 +0100 Subject: [PATCH] termvector -> termvectors rename + bw compatibility alias --- elasticsearch/client/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 2d253639..0d32aa48 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -921,10 +921,14 @@ class Elasticsearch(object): @query_params('field_statistics', 'fields', 'offsets', 'parent', 'payloads', 'positions', 'preference', 'realtime', 'routing', 'term_statistics') - def termvector(self, index, doc_type, id, body=None, params=None): + def termvectors(self, index, doc_type, id, body=None, params=None): """ - Added in 1. - ``_ + Returns information and statistics on terms in the fields of a + particular document. The document could be stored in the index or + artificially provided by the user (Added in 1.4). Note that for + documents stored in the index, this is a near realtime API as the term + vectors are not available until the next refresh. + `` :arg index: The index in which the document resides. :arg doc_type: The type of the document. @@ -953,6 +957,9 @@ class Elasticsearch(object): doc_type, id, '_termvector'), params=params, body=body) return data + # backwards compatibility + termvector = termvectors + @query_params('field_statistics', 'fields', 'ids', 'offsets', 'parent', 'payloads', 'positions', 'preference', 'routing', 'term_statistics') def mtermvectors(self, index=None, doc_type=None, body=None, params=None):