Elasticsearch Percolate with 6.x

The 6.x doco says document_type is deprecated for Percolate (https://www.elastic.co/guide/en/elasticsearch/reference/6.0/breaking_60_search_changes.html)

  • The percolate query’s document_type has been deprecated. From 6.0 and later it is no longer required to specify the document_type parameter.

With Elasticsearch 6.8 jar , getting an error if use non-deprecated methode of public "PercolateQueryBuilder"
{"type":"illegal_argument_exception","reason":"[percolate] query is missing required [document_type] parameter"}}}]},"status":400}

Deprecated one still working against 6.8 elasticsearch cluster : @Deprecated
public PercolateQueryBuilder(String field, String documentType, String indexedDocumentIndex,
String indexedDocumentType, String indexedDocumentId, String indexedDocumentRouting,
String indexedDocumentPreference, Long indexedDocumentVersion) {

What is recommended with 6.x jar for below percolate query?

{
"from":0,
"size":200,
"query":{
"bool":{
"must":[
{
"percolate":{
"document_type":<document_type>,
"field":"query",
"index":"INDEX",
"type":"<content_Type>",
"id":"<content_Id>",
"boost":1.0
}
},
{
"term":{
"status":{
"value":"active",
"boost":1.0
}
}
}
],
"adjust_pure_negative":true,
"boost":1.0
}
}
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.