Skip to content

The documentation for MultiMatchQuery#minimumShouldMatch says it outputs percentages, but does integers: #7

@emig

Description

@emig

First, thanks for the fork!

I wanted to report the following issue:

The documentation is not according with the code

It claims that MultiMatchQuery#minimumShouldMatch:

Sets a percent value controlling how many "should" clauses in the resulting Query should match.

and that the:

Parameters
minMatch An integer between 0 and 100.

but is not the case.
Once the function is called with an integer parameter, the output JSON for that field is an integer, and not the expected percentage.

{ multi_match:
   { query: 'test_query',
     fields: [ 'test_field' ],
     minimum_should_match: 4 } }

The api for [minimum-should-match in the es documentation](https://www.elastic.co/guide/en/elasticsearch/reference/1.4/query-dsl-minimum- +should-match.html) distinguishes the case for:

Type Example Description
Integer 3 Indicates a fixed value regardless of the number of optional clauses.
Percentage 75% Indicates that this percent of the total number of optional clauses are necessary. The number computed +from the percentage is rounded down and used as the minimum.

If my analysis is correct, the documentation could be updated, describing that it is accepted a String representing any of the minimum_should_match options

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions