Minor regression in Java API 0.19.9?

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.

--

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 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

--

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.

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:

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 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.

--

--

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 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
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

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 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.

--

--

--

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

--