diff --git a/datasets/datasets.json b/datasets/datasets.json index c9111a04..b3622777 100644 --- a/datasets/datasets.json +++ b/datasets/datasets.json @@ -138,7 +138,8 @@ "schema": { "update_date_ts": "int", "labels": "keyword", - "submitter": "keyword" + "submitter": "keyword", + "id": "keyword" } }, { diff --git a/engine/clients/opensearch/parser.py b/engine/clients/opensearch/parser.py index 31eccd8f..527dc5ab 100644 --- a/engine/clients/opensearch/parser.py +++ b/engine/clients/opensearch/parser.py @@ -25,7 +25,12 @@ def build_range_filter( lte: Optional[FieldValue], gte: Optional[FieldValue], ) -> Any: - return {"range": {field_name: {"lt": lt, "gt": gt, "lte": lte, "gte": gte}}} + field_filters = { + k: v + for k, v in {"lt": lt, "gt": gt, "lte": lte, "gte": gte}.items() + if v is not None + } + return {"range": {field_name: field_filters}} def build_geo_filter( self, field_name: str, lat: float, lon: float, radius: float