From 4158f6570372e30af99f87fe698bf2ecf7906d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Doumouro?= Date: Thu, 5 Dec 2024 13:13:24 +0100 Subject: [PATCH] feature: add `or_query` to es utils --- icij-common/icij_common/es/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/icij-common/icij_common/es/__init__.py b/icij-common/icij_common/es/__init__.py index 3cd30c6..812ea44 100644 --- a/icij-common/icij_common/es/__init__.py +++ b/icij-common/icij_common/es/__init__.py @@ -243,6 +243,10 @@ def and_query(*queries: Dict) -> Dict: return bool_query({MUST: list(queries)}) +def or_query(*queries: Dict) -> Dict: + return bool_query({SHOULD: list(queries)}) + + def must(*queries: Dict) -> Dict: return {MUST: list(queries)}