Elasticsearch Match phrase prefix query remove parameter zero_terms_query

I am using Elasticsearch 6.2.4 with JEST client.

using following library

"org.elasticsearch" % "elasticsearch" % "6.2.4"

But now i updated the library to 7.15 as

"org.elasticsearch" % "elasticsearch" % "7.15.0"

using same JEST client .

so after upgrade search query failing with following error

{"error":{"root_cause":[{"type":"parsing_exception","reason":"[match_phrase_prefix] query does not support [zero_terms_query]","line":1,"col":497}],"type":"parsing_exception","reason":"[match_phrase_prefix] query does not support [zero_terms_query]","line":1,"col":497},"status":400}

error occurred because library 7.15 added(QueryBuilders.matchPhrasePrefixQuery()) new parameter "zero_terms_query" to match_phrase_prefix query

     "match_phrase_prefix" : {
          "title" : {
            "query" : "a",
            "slop" : 2,
            "max_expansions" : 100,
            "zero_terms_query" : "NONE",
            "boost" : 1.0
          }
        }

with 6.2.4 query exactly the same except parameter "zero_terms_query" : "NONE",
so i am looking a way, if is it possible pragmatically to remove this parameter from "matchPhrasePrefixQuery" query, however,it is possible to view default value is set to zero_terms_query parameter by this method

MatchPhrasePrefixQueryBuilder.zeroTermsQuery()

but there is no way to get rid of this parameter from the query, any solution ?

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