Skip to content

__and__ operator fails for Bool with minimum_should_match in percentage #1451

@mmoriniere

Description

@mmoriniere

Hello,

I ran into on an error when trying to chain two such queries :

MyDocument.search().query(
    Bool(filter=Term(disabled=False))
).query(
    Bool(should=[my_should_clauses], minimum_should_match="-10%")
)

(where MyDocument derives from the Document class of django_elasticsearch_dsl).

The error happens here, and there actually is a TODO three lines above suggesting that this problem is known and ought to be fixed.

Is there any plan to support such a feature ?

Note: I already found two workarounds to avoid this issue :

  1. Refactor my code to use just one query,
  2. Make the second query look like this Bool(filter=Bool(should=[my_should_clauses], minimum_should_match="-10%")).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions