Skip to content

Commit

Permalink
fix(#1522): dates metadata fields accessible for sorting (#1529)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3a52dd9)
  • Loading branch information
leiyre authored and frascuchon committed Jun 7, 2022
1 parent 88b20bd commit a576ceb
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/rubrix/server/elasticseach/query_helpers.py
Expand Up @@ -413,14 +413,8 @@ def __resolve_aggregation_for_field_type(
field_type: str, field_name: str
) -> Optional[Dict[str, Any]]:
if field_type in ["keyword", "long", "integer", "boolean"]:
return {
"terms": {
"field": field_name,
"size": size or aggregations.DEFAULT_AGGREGATION_SIZE,
"order": {"_count": "desc"},
}
}
if field_type in ["float", "long"]:
return aggregations.terms_aggregation(field_name=field_name, size=size)
if field_type in ["float", "date"]:
# TODO: Revise boxplot (since elasticsearch version 7.11 and not sure for opensearch)
return {"extended_stats": {"field": field_name}}
return None # TODO: revise elasticsearch aggregations for API match
Expand Down

0 comments on commit a576ceb

Please sign in to comment.