Hi everyone, I was wondering if you could help me.
I found an interesting feature added in a specific PR:
But I can't find documentation of how to use that using java HighLevel rest client. Was that removed?
That PR was for 7.12, and I'm using 7.8.1
Hi everyone, I was wondering if you could help me.
I found an interesting feature added in a specific PR:
But I can't find documentation of how to use that using java HighLevel rest client. Was that removed?
That PR was for 7.12, and I'm using 7.8.1
I'm confused right now. Is that only allowed for .NET client?
You need 7.12. I just tried this:
@Test
void highlight() throws IOException {
try {
client.indices().delete(new DeleteIndexRequest("highlight"), RequestOptions.DEFAULT);
} catch (ElasticsearchStatusException ignored) {
}
client.index(new IndexRequest("highlight").source("{\"foo\":\"bar\"}", XContentType.JSON), RequestOptions.DEFAULT);
client.indices().refresh(new RefreshRequest("highlight"), RequestOptions.DEFAULT);
client.search(new SearchRequest("highlight").source(
new SearchSourceBuilder()
.query(QueryBuilders.matchQuery("foo", "bar"))
.highlighter(new HighlightBuilder().field("foo").maxAnalyzedOffset(10)
)
), RequestOptions.DEFAULT);
}
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.