Minimum_should_match is not working

(kanchan) #1


I have used minimum_should_match as 10% or 80% both are giving same result.there is no difference in output.Please let me know why minimum_should_match is not working.

GET /hist_latest/_search
"query": {
"bool": {
"should": [
"multi_match" : {
"query": "Pravin MEH",
"type": "best_fields",
"fields": [ "bank_client_entity_name" ],
"minimum_should_match": "80%"

(Matt Bargar) #2

Here's what I suspect is happening:

Assuming your analyzer splits on whitespace, your query only contains two terms: Pravin and MEH.

When you use percentages with minimum_should_match, the number computed from the percentage is rounded down and used as the minimum. Since you only have two terms, 10% of 2 is 0.2, which rounds down to 0. However, minimum_should_match will never use a value less than 1, so 10% becomes 1. 80% of 2 is 1.6, which rounds down to 1. So for this particular query with only two terms, 10% and 80% are equivalent. Try a query with more terms, or try 50% vs 100%.

(kanchan) #3

Thanks, I understand the flow.but if I wanna to take character wise tokens and percent calculation on it.then how can I achieve it.

(Matt Bargar) #4

I don't understand, can you explain further?

(system) #5

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