# Elasticsearch Match phrase prefix query remove parameter zero\_terms\_query

**URL:** <https://discuss.elastic.co/t/elasticsearch-match-phrase-prefix-query-remove-parameter-zero-terms-query/286127>\
**Category:** Elasticsearch\
**Created:** [October 7, 2021, 12:06pm UTC](https://discuss.elastic.co/t/elasticsearch-match-phrase-prefix-query-remove-parameter-zero-terms-query/286127 "2021-10-07T12:06:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ijaxahmed](https://avatars.discourse-cdn.com/v4/letter/i/f17d59/32.png) [@ijaxahmed](https://discuss.elastic.co/u/ijaxahmed)\
**Post date:** [October 7, 2021, 12:06pm UTC](https://discuss.elastic.co/t/elasticsearch-match-phrase-prefix-query-remove-parameter-zero-terms-query/286127/1 "2021-10-07T12:06:53Z")

</div>

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

```auto
     "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 ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2021, 12:07pm UTC](https://discuss.elastic.co/t/elasticsearch-match-phrase-prefix-query-remove-parameter-zero-terms-query/286127/2 "2021-11-04T12:07:05Z")

</div>

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