Solving Searchable String ID Sorting Issue
TLDR 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.
1
1
1
Dec 23, 2021 (25 months ago)
Mubashirullah
07:58 AMI have this situation where I need to add id as searchable_id string since the client needs to search by it. But then, I have to add the id again as sort_id int so I can sort by it. I wish I could use my normal id for searching as well
Kishore Nallan
07:58 AMMubashirullah
08:46 AMKishore Nallan
09:11 AMMubashirullah
09:19 AMDec 24, 2021 (25 months ago)
Kishore Nallan
01:28 PMMubashirullah
01:29 PMKishore Nallan
01:29 PMtypesense/typesense:0.23.0.rc10
You should explicitly enable string sorting at a field level like this:
{"name": "title", "type": "string", "sort": true }
You can now include the
title
field in the sort_by
clause.1
1
Kishore Nallan
01:30 PMKishore Nallan
01:31 PMMubashirullah
01:34 PMKishore Nallan
01:40 PM1
Typesense
Indexed 3011 threads (79% resolved)
Similar Threads
Adjusting Text Match Score Calculation in TypeSense
Johannes wanted to modify the Text Match Score calculation in TypeSense to improve search results returns. With counsel from Jason and Kishore Nallan, various solutions were proposed, including creating a Github issue, attempting different parameters, and updating Docker to a new version to resolve the matter.
Improving Typesense Query Performance
Jonathan queried about slower than expected typesense query performance. Jason and Kishore Nallan offered solutions and explanations. After a series of tests, Jonathan found other queries returned results quickly, indicating the issue was specific to the original query.
Troubleshooting Typesense Document Import Error
Christopher had trouble importing 2.1M documents into Typesense due to memory errors. Jason clarified the system requirements, explaining the correlation between RAM and dataset size, and ways to tackle the issue. They both also discussed database-like query options.
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.
Discussing Ability to Sort by a Text Field
Aljosa asks about sorting by text fields and proposes a workaround. Kishore Nallan discusses database implications and possible workarounds, informing that changes may require reindexing. Andrew expresses interest in string sorting.