Integration Issues with Highlights in Typesense
TLDR Michael was struggling with integrating highlights into their work. Dima and Jason offered clarifications and suggestions. Michael decided to try Jason's solution.
1
1
Aug 07, 2023 (4 months ago)
Michael
02:07 PMSeems very cumbersome at this stage to be fair. I have a full blown result in the search overview, with the bigger dataset as above, but to replace fields/data if/when there is a hit seems weird.
Isn't there a possibility to add the highlight in the actual returned field, or at least a reference towards it? Kishore Nallan Jason :thinking_face:
Dima
02:28 PMhighlights
for each found hit, you can see it in the example responseDima
02:29 PMdocument
?Michael
02:56 PM1
Jason
03:39 PMI usually do
hit.highlight.fieldX?.value || hit.document.fieldX
in JS for eg to check if a highlight exists for a field, if not fallback to the unhighlighted fieldAug 08, 2023 (4 months ago)
Michael
07:12 AMJason
04:12 PMhighlights
key in the response which has a different structure (we’ll be deprecating it in a future version, but just keeping it around for backward compatibility).Instead you want to use the new
highlight
(singular) key (as of v0.24.1) which should be much easier to parse1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Phrase Search Relevancy and Weights Fix
Jan reported an issue with phrase search relevancy using Typesense Instantsearch Adapter. The problem occurred when searching phrases with double quotes. The team identified the issue to be related to weights and implemented a fix, improving the search results.
Querying and Indexing Multiple Elements Issues
Krish queried fields with multiple elements, which Kishore Nallan suggested checking `drop_tokens_threshold`. Krish wished to force OR mode for token, but Kishore Nallan admitted the feature was missing. Krish was able to resolve the issue with url encoding.
Issue with Typesense Search and Special Characters
gab faced an issue with Typesense when searching with special characters. Jason and Kishore Nallan provided support and identified the issue as a bug. The problem was resolved after upgrading to `0.25.0.rc44`.