Skip to content

Commit

Permalink
facets: fix bool query
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Feb 27, 2024
1 parent 129c4cd commit 594199c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions invenio_app_ils/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,10 @@ def inner(values):
if range_key in values:
for key, value in mappings.items():
args[key] = value
range_query = dsl.query.Range(**{field: args})
terms_query = dsl.Q("terms", **{"state": current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]})

return dsl.query.Bool(
[
dsl.query.Range(**{field: args}),
dsl.Q(
"terms",
**{"state": current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]}
),
]
)
return dsl.query.Bool(must=[range_query, terms_query])

return inner

Expand Down

0 comments on commit 594199c

Please sign in to comment.