I have been receiving warning messages each time my app does percolate. I'm using the 7.4.0 versions of elasticsearch and percolate clients. Elasticsearch is also at 7.4.0 version. I know types are deprecated at 7th version, but PercolateQueryBuilder
class is still requiring indexedDocumentType
. I have checked other constructors, but it doesn't offer a constructor to build percolate query without a type.
Warning message:
request [POST http://localhost:9200/saved_searches/_search?typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&scroll=1m&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true] returned 1 warnings: [299 Elasticsearch-7.4.0-22e1767283e61a198cb4db791ea66e3f11ab9910 "[types removal] Types are deprecated in [percolate] queries. The [type] of the indexed document should no longer be specified."]
Code to run percolating job.
PercolateQueryBuilder percolateQuery = new PercolateQueryBuilder("query",
"order", "_doc", order.getId(),
null,
null,
null);
SearchRequest searchRequest = new SearchRequest("saved_search");
SearchSourceBuilder searchSourceBuilder = SearchSourceBuilder.searchSource()
.storedFields(Collections.emptyList())
.query(constantScoreQuery(percolateQuery));
searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
I can't find what I have done wrong.