Queryable Int32 Field for Sorting and Query By
TLDR JP wants to make an
int32 field queryable and sortable. Jason suggests creating integer and string versions of the field, but acknowledges the need for integer fields in query_by.
Mar 02, 2023 (9 months ago)
int32field that we want to be queryable (using
query_by), but also to
sort_by. For it to be queryable, we have to set the field's type to
stringin the schema, but sorting on it produces the wrong results. Since these values are now strings instead of numbers if we sort them ascending, we get results for
20, etc instead of
Is there a way to do a type cast or transformation on the field when sorting? Something like
This came up recently in another context, mind copy-pasting your use-case into this GitHub issue: https://github.com/typesense/typesense/issues/917
This gives an even better use-case to support integer fields in query_by
Indexed 3015 threads (79% resolved)
Solving Searchable String ID Sorting Issue
Mubashirullah needed to sort by string id, which was not supported. Kishore Nallan offered a preview Docker build with the feature. Mubashirullah expressed satisfaction with the solution.
Querying Integer Fields in query_by
Saurabh wants to query an integer field in `query_by`. Kishore Nallan suggests indexing the field as a string instead to properly query it.
Methods for Fetching, Querying, and Modifying Collections in Typesense
Bill inquired about performing OR queries, querying empty arrays and modifying collections in Typesense. Kishore Nallan explained the current limitations and provided workarounds and recommendations for each case. The conversation also touched upon the usage of cache in Typesense and the workings of the _eval function.