Skip to content

Commit

Permalink
Small corrections to HLRC doc for _termvectors (#35221)
Browse files Browse the repository at this point in the history
Relates to #33447
  • Loading branch information
mayya-sharipova committed Nov 5, 2018
1 parent 12eaac7 commit 54365fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1545,23 +1545,23 @@ public void afterBulk(long executionId, BulkRequest request,
// Not entirely sure if _termvectors belongs to CRUD, and in the absence of a better place, will have it here
public void testTermVectors() throws Exception {
RestHighLevelClient client = highLevelClient();
CreateIndexRequest authorsRequest = new CreateIndexRequest("authors").mapping("doc", "user", "type=keyword");
CreateIndexRequest authorsRequest = new CreateIndexRequest("authors").mapping("_doc", "user", "type=keyword");
CreateIndexResponse authorsResponse = client.indices().create(authorsRequest, RequestOptions.DEFAULT);
assertTrue(authorsResponse.isAcknowledged());
client.index(new IndexRequest("index", "doc", "1").source("user", "kimchy"), RequestOptions.DEFAULT);
client.index(new IndexRequest("index", "_doc", "1").source("user", "kimchy"), RequestOptions.DEFAULT);
Response refreshResponse = client().performRequest(new Request("POST", "/authors/_refresh"));
assertEquals(200, refreshResponse.getStatusLine().getStatusCode());

{
// tag::term-vectors-request
TermVectorsRequest request = new TermVectorsRequest("authors", "doc", "1");
TermVectorsRequest request = new TermVectorsRequest("authors", "_doc", "1");
request.setFields("user");
// end::term-vectors-request
}

{
// tag::term-vectors-request-artificial
TermVectorsRequest request = new TermVectorsRequest("authors", "doc");
TermVectorsRequest request = new TermVectorsRequest("authors", "_doc");
XContentBuilder docBuilder = XContentFactory.jsonBuilder();
docBuilder.startObject().field("user", "guest-user").endObject();
request.setDoc(docBuilder); // <1>
Expand Down Expand Up @@ -1594,7 +1594,7 @@ public void testTermVectors() throws Exception {
// end::term-vectors-request-optional-arguments
}

TermVectorsRequest request = new TermVectorsRequest("authors", "doc", "1");
TermVectorsRequest request = new TermVectorsRequest("authors", "_doc", "1");
request.setFields("user");

// tag::term-vectors-execute
Expand Down
6 changes: 3 additions & 3 deletions docs/java-rest/high-level/document/term-vectors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ include::../execution.asciidoc[]


[id="{upid}-{api}-response"]
==== TermVectorsResponse
==== Term Vectors Response

The `TermVectorsResponse` contains the following information:
+{response}+ contains the following information:

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
Expand All @@ -77,7 +77,7 @@ include-tagged::{doc-tests-file}[{api}-response]


===== Inspecting Term Vectors
If `TermVectorsResponse` contains non-null list of term vectors,
If +{response}+ contains non-null list of term vectors,
more information about each term vector can be obtained using the following:

["source","java",subs="attributes,callouts,macros"]
Expand Down

0 comments on commit 54365fc

Please sign in to comment.