Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Conversation

@cewald
Copy link

@cewald cewald commented Oct 13, 2020

If you use an or/nor filter it would be applied without a specific minimum_should_match value. This could lead into wrong results as it is not adding a reducing filter, just a or/nor that doesn't affect the results.

Example:

Consider the following final query:

{
  "query": {
    "bool": {
      "filter": {
        "bool": {
          "must": [
            {
              "terms": {
                "color": [ "blue" ]
              }
            }
          ],
          "should": [
            {
              "terms": {
                "size": [ 11 ]
              }
            },
            {
              "terms": {
                "is_in_sale": [ 1 ]
              }
            }
          ]
        }
      }
    }
  }
}

We wan't to load products that have the color "blue" and products that are "in sale" or have size "1"
– BUT without minimum_should_match we just ask for a definitiv color and the should filter must not be fulfilled as minimum_should_match is 0 by default.

@Fifciu Fifciu requested a review from gibkigonzo October 28, 2020 10:15
@cewald
Copy link
Author

cewald commented Nov 30, 2020

@Fifciu @gibkigonzo I've updated to the latest master branch – are any updated/changes necessary?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants