# Minor regression in Java API 0.19.9?

**URL:** <https://discuss.elastic.co/t/minor-regression-in-java-api-0-19-9/8873>\
**Category:** Elasticsearch\
**Created:** [August 28, 2012, 3:57pm UTC](https://discuss.elastic.co/t/minor-regression-in-java-api-0-19-9/8873 "2012-08-28T15:57:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_Fiedler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jan_fiedler/32/2518_2.png) [@Jan\_Fiedler](https://discuss.elastic.co/u/Jan_Fiedler)\
**Post date:** [August 28, 2012, 3:57pm UTC](https://discuss.elastic.co/t/minor-regression-in-java-api-0-19-9/8873/1 "2012-08-28T15:57:58Z")

</div>

I just upgraded to 0.19.9 and my test suite (using Java client) found a  
minor regression that I wanted to double-check with the experts.  
Calling QueryBuilders.boolQuery().minimumNumberShouldMatch( 1 ) generates  
different json 0.19.8 and 0.19.9:

_0.19.8_

"bool" : {  
"minimum\_number\_should\_match" : 1  
}

_0.19.9_

"bool" : {  
"minimum\_should\_match" : "1"  
}

This is minor - however I just want to make sure we are not breaking  
compatiblity at the Json level.

--

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [August 29, 2012, 9:23am UTC](https://discuss.elastic.co/t/minor-regression-in-java-api-0-19-9/8873/2 "2012-08-29T09:23:00Z")

</div>

Hi Jan,

At the json level both "minimum\_should\_match" and  
"minimum\_number\_should\_match" can be used (You can see that in  
BoolQueryParser).

Martijn

On 28 August 2012 17:57, Jan Fiedler [fiedler.jan@gmail.com](mailto:fiedler.jan@gmail.com) wrote:

> I just upgraded to 0.19.9 and my test suite (using Java client) found a  
> minor regression that I wanted to double-check with the experts. Calling  
> QueryBuilders.boolQuery().minimumNumberShouldMatch( 1 ) generates different  
> json 0.19.8 and 0.19.9:
> 
> 0.19.8
> 
> "bool" : {  
> "minimum\_number\_should\_match" : 1  
> }
> 
> 0.19.9
> 
> "bool" : {  
> "minimum\_should\_match" : "1"  
> }
> 
> This is minor - however I just want to make sure we are not breaking  
> compatiblity at the Json level.
> 
> --

--  
Met vriendelijke groet,

Martijn van Groningen

--

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [August 29, 2012, 6:29pm UTC](https://discuss.elastic.co/t/minor-regression-in-java-api-0-19-9/8873/3 "2012-08-29T18:29:27Z")

</div>

Just to be perfectly clear. As Martin said, these are synonyms of each  
other when applied to boolQuery.

"minimum\_should\_match" is not documented (but now it is for those searching the e-mail list!)

minimum\_should\_match is actually described on the site as parameter to query\_string.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

And is a _percent_ as used there.

While minimum\_number\_should\_match is the name of a property of BoolQuery and BoolQueryBuilder and doc'ed at:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Thus the generated json is using the "wrong" term (it neither matches the code nor docs, but is usable).

Someone else can decide if the right thing to do is to change it back to what it was and how that effects query\_string.

-Paul

On 8/29/2012 2:23 AM, Martijn v Groningen wrote:

> Hi Jan,
> 
> At the json level both "minimum\_should\_match" and  
> "c" can be used (You can see that in  
> BoolQueryParser).
> 
> Martijn
> 
> On 28 August 2012 17:57, Jan Fiedler [fiedler.jan@gmail.com](mailto:fiedler.jan@gmail.com) wrote:
> 
> > I just upgraded to 0.19.9 and my test suite (using Java client) found a  
> > minor regression that I wanted to double-check with the experts. Calling  
> > QueryBuilders.boolQuery().minimumNumberShouldMatch( 1 ) generates different  
> > json 0.19.8 and 0.19.9:
> > 
> > 0.19.8
> > 
> > "bool" : {  
> > "minimum\_number\_should\_match" : 1  
> > }
> > 
> > 0.19.9
> > 
> > "bool" : {  
> > "minimum\_should\_match" : "1"  
> > }
> > 
> > This is minor - however I just want to make sure we are not breaking  
> > compatiblity at the Json level.
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 29, 2012, 9:18pm UTC](https://discuss.elastic.co/t/minor-regression-in-java-api-0-19-9/8873/4 "2012-08-29T21:18:23Z")

</div>

The current behavior is fully backward compatible with previous versions. The json generated generates minimum\_should\_match, but minimum\_number\_should\_match also works.

The idea was the streamline all places where the parameter is applicable to use the same name (minimum\_should\_match), and also streamline the support for more complex expression there except for "5" (or a number). For example, using percentage like "20%". This should be properly documented (the syntax) and referred to in the different queries it applies to.

On Aug 29, 2012, at 9:30 PM, P. Hill [parehill1@gmail.com](mailto:parehill1@gmail.com) wrote:

> Just to be perfectly clear. As Martin said, these are synonyms of each other when applied to boolQuery.
> 
> "minimum\_should\_match" is not documented (but now it is for those searching the e-mail list!)
> 
> minimum\_should\_match is actually described on the site as parameter to query\_string.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html)  
> And is a _percent_ as used there.
> 
> While minimum\_number\_should\_match is the name of a property of BoolQuery and BoolQueryBuilder and doc'ed at:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/bool-query.html)
> 
> Thus the generated json is using the "wrong" term (it neither matches the code nor docs, but is usable).
> 
> Someone else can decide if the right thing to do is to change it back to what it was and how that effects query\_string.
> 
> -Paul
> 
> On 8/29/2012 2:23 AM, Martijn v Groningen wrote:
> 
> > Hi Jan,
> > 
> > At the json level both "minimum\_should\_match" and  
> > "c" can be used (You can see that in  
> > BoolQueryParser).
> > 
> > Martijn
> > 
> > On 28 August 2012 17:57, Jan Fiedler [fiedler.jan@gmail.com](mailto:fiedler.jan@gmail.com) wrote:
> > 
> > > I just upgraded to 0.19.9 and my test suite (using Java client) found a  
> > > minor regression that I wanted to double-check with the experts. Calling  
> > > QueryBuilders.boolQuery().minimumNumberShouldMatch( 1 ) generates different  
> > > json 0.19.8 and 0.19.9:
> > > 
> > > 0.19.8
> > > 
> > > "bool" : {  
> > > "minimum\_number\_should\_match" : 1  
> > > }
> > > 
> > > 0.19.9
> > > 
> > > "bool" : {  
> > > "minimum\_should\_match" : "1"  
> > > }
> > > 
> > > This is minor - however I just want to make sure we are not breaking  
> > > compatiblity at the Json level.
> > > 
> > > --
> 
> --

--

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [September 5, 2012, 3:26am UTC](https://discuss.elastic.co/t/minor-regression-in-java-api-0-19-9/8873/5 "2012-09-05T03:26:38Z")

</div>

On 8/29/2012 2:18 PM, Shay Banon wrote:

> This should be properly documented (the syntax) and referred to in the different queries it applies to.

Glad to clarify what needs to be changed. In this case only the documentation.

-Paul

--

---

<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:** [July 6, 2017, 3:14am UTC](https://discuss.elastic.co/t/minor-regression-in-java-api-0-19-9/8873/6 "2017-07-06T03:14:08Z")

</div>


