From a0b706d59350d2cb8436963ba2156dedbdd2177d Mon Sep 17 00:00:00 2001 From: Mayya Sharipova Date: Wed, 24 Oct 2018 17:57:35 -0400 Subject: [PATCH] Reduce the number of callouts to 15 in docs relates to #33447 --- .../documentation/CRUDDocumentationIT.java | 32 +++++++++--------- .../high-level/document/term-vectors.asciidoc | 33 +++++++++---------- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CRUDDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CRUDDocumentationIT.java index dd2c6d4832258..7f3b980becd8d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CRUDDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CRUDDocumentationIT.java @@ -1576,27 +1576,27 @@ public void testTermVectors() throws Exception { // tag::term-vectors-term-vectors if (response.getTermVectorsList() != null) { - List tvList = response.getTermVectorsList(); // <1> + List tvList = response.getTermVectorsList(); for (TermVectorsResponse.TermVector tv : tvList) { - String fieldname = tv.getFieldName(); // <2> - int docCount = tv.getFieldStatistics().getDocCount(); // <3> - long sumTotalTermFreq = tv.getFieldStatistics().getSumTotalTermFreq(); // <4> - long sumDocFreq = tv.getFieldStatistics().getSumDocFreq(); // <5> + String fieldname = tv.getFieldName(); // <1> + int docCount = tv.getFieldStatistics().getDocCount(); // <2> + long sumTotalTermFreq = tv.getFieldStatistics().getSumTotalTermFreq(); // <3> + long sumDocFreq = tv.getFieldStatistics().getSumDocFreq(); // <4> if (tv.getTerms() != null) { - List terms = tv.getTerms(); // <6> + List terms = tv.getTerms(); // <5> for (TermVectorsResponse.TermVector.Term term : terms) { - String termStr = term.getTerm(); // <7> - int termFreq = term.getTermFreq(); // <8> - int docFreq = term.getDocFreq(); // <9> - long totalTermFreq = term.getTotalTermFreq(); // <10> - float score = term.getScore(); // <11> + String termStr = term.getTerm(); // <6> + int termFreq = term.getTermFreq(); // <7> + int docFreq = term.getDocFreq(); // <8> + long totalTermFreq = term.getTotalTermFreq(); // <9> + float score = term.getScore(); // <10> if (term.getTokens() != null) { - List tokens = term.getTokens(); // <12> + List tokens = term.getTokens(); // <11> for (TermVectorsResponse.TermVector.Token token : tokens) { - int position = token.getPosition(); // <13> - int startOffset = token.getStartOffset(); // <14> - int endOffset = token.getEndOffset(); // <15> - String payload = token.getPayload(); // <16> + int position = token.getPosition(); // <12> + int startOffset = token.getStartOffset(); // <13> + int endOffset = token.getEndOffset(); // <14> + String payload = token.getPayload(); // <15> } } } diff --git a/docs/java-rest/high-level/document/term-vectors.asciidoc b/docs/java-rest/high-level/document/term-vectors.asciidoc index 1e119d21a9132..e739e37732fd4 100644 --- a/docs/java-rest/high-level/document/term-vectors.asciidoc +++ b/docs/java-rest/high-level/document/term-vectors.asciidoc @@ -78,25 +78,24 @@ include-tagged::{doc-tests-file}[{api}-response] ===== Inspecting Term Vectors If `TermVectorsResponse` contains non-null list of term vectors, -more information about them can be obtained using following: +more information about each term vector can be obtained using the following: ["source","java",subs="attributes,callouts,macros"] -------------------------------------------------- include-tagged::{doc-tests-file}[{api}-term-vectors] -------------------------------------------------- -<1> The list of `TermVector` for the document -<2> The name of the current field -<3> Fields statistics for the current field - document count -<4> Fields statistics for the current field - sum of total term frequencies -<5> Fields statistics for the current field - sum of document frequencies -<6> Terms for the current field -<7> The name of the term -<8> Term frequency of the term -<9> Document frequency of the term -<10> Total term frequency of the term -<11> Score of the term -<12> Tokens of the term -<13> Position of the token -<14> Start offset of the token -<15> End offset of the token -<16> Payload of the token +<1> The name of the current field +<2> Fields statistics for the current field - document count +<3> Fields statistics for the current field - sum of total term frequencies +<4> Fields statistics for the current field - sum of document frequencies +<5> Terms for the current field +<6> The name of the term +<7> Term frequency of the term +<8> Document frequency of the term +<9> Total term frequency of the term +<10> Score of the term +<11> Tokens of the term +<12> Position of the token +<13> Start offset of the token +<14> End offset of the token +<15> Payload of the token