Small corrections to HLRC doc for _termvectors (#35221)
Relates to #33447
This commit is contained in:
parent
28078642b3
commit
a2c22ad7ae
|
@ -1549,23 +1549,23 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
|
||||||
// Not entirely sure if _termvectors belongs to CRUD, and in the absence of a better place, will have it here
|
// 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 {
|
public void testTermVectors() throws Exception {
|
||||||
RestHighLevelClient client = highLevelClient();
|
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);
|
CreateIndexResponse authorsResponse = client.indices().create(authorsRequest, RequestOptions.DEFAULT);
|
||||||
assertTrue(authorsResponse.isAcknowledged());
|
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"));
|
Response refreshResponse = client().performRequest(new Request("POST", "/authors/_refresh"));
|
||||||
assertEquals(200, refreshResponse.getStatusLine().getStatusCode());
|
assertEquals(200, refreshResponse.getStatusLine().getStatusCode());
|
||||||
|
|
||||||
{
|
{
|
||||||
// tag::term-vectors-request
|
// tag::term-vectors-request
|
||||||
TermVectorsRequest request = new TermVectorsRequest("authors", "doc", "1");
|
TermVectorsRequest request = new TermVectorsRequest("authors", "_doc", "1");
|
||||||
request.setFields("user");
|
request.setFields("user");
|
||||||
// end::term-vectors-request
|
// end::term-vectors-request
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// tag::term-vectors-request-artificial
|
// tag::term-vectors-request-artificial
|
||||||
TermVectorsRequest request = new TermVectorsRequest("authors", "doc");
|
TermVectorsRequest request = new TermVectorsRequest("authors", "_doc");
|
||||||
XContentBuilder docBuilder = XContentFactory.jsonBuilder();
|
XContentBuilder docBuilder = XContentFactory.jsonBuilder();
|
||||||
docBuilder.startObject().field("user", "guest-user").endObject();
|
docBuilder.startObject().field("user", "guest-user").endObject();
|
||||||
request.setDoc(docBuilder); // <1>
|
request.setDoc(docBuilder); // <1>
|
||||||
|
@ -1598,7 +1598,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
|
||||||
// end::term-vectors-request-optional-arguments
|
// end::term-vectors-request-optional-arguments
|
||||||
}
|
}
|
||||||
|
|
||||||
TermVectorsRequest request = new TermVectorsRequest("authors", "doc", "1");
|
TermVectorsRequest request = new TermVectorsRequest("authors", "_doc", "1");
|
||||||
request.setFields("user");
|
request.setFields("user");
|
||||||
|
|
||||||
// tag::term-vectors-execute
|
// tag::term-vectors-execute
|
||||||
|
|
|
@ -62,9 +62,9 @@ include::../execution.asciidoc[]
|
||||||
|
|
||||||
|
|
||||||
[id="{upid}-{api}-response"]
|
[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"]
|
["source","java",subs="attributes,callouts,macros"]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
@ -77,7 +77,7 @@ include-tagged::{doc-tests-file}[{api}-response]
|
||||||
|
|
||||||
|
|
||||||
===== Inspecting Term Vectors
|
===== 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:
|
more information about each term vector can be obtained using the following:
|
||||||
|
|
||||||
["source","java",subs="attributes,callouts,macros"]
|
["source","java",subs="attributes,callouts,macros"]
|
||||||
|
|
Loading…
Reference in New Issue