Open
Description
redis-om-python
: 0.1.2
python
: 3.10
When setting a datetime
Field with index=True
, the field index is created as a TAG
. Queries that use >
or <
return no data, as the query expression is evaluated to ""
.
This happens in both HashModel
and JsonModel
.
If the field is also defined with sortable=True
AND the model is a JsonModel
, the model definition raises a RedisModelError
:
In this Preview release, TAG fields cannot be marked as sortable. Problem field: end_date. See docs: TODO
However if the model is a HashModel
, no such exception is raised.
Possible solutions:
- Store and index
datetime
fields asNUMERIC
. - Index
daetime
fields asTEXT
and applyparsetime
to create a new query field for sorting.