#random

Escaping Encoding for Special Characters in Typesense

TLDR Nima asked about escaping encoding for special characters in Typesense. Kishore Nallan suggested checking raw response and mentioned that decoding might be needed before indexing.

Powered by Struct AI

1

Jun 13, 2023 (6 months ago)
Nima
Photo of md5-aaf4a8300f867ebf0c8d3e9f152943ee
Nima
05:55 AM
Hey guys
Is there a setting in Typesense where we can escape encoding for special characters.
Right now this is what we see:
Thank you
Image 1 for Hey guys
Is there a setting in Typesense where we can escape encoding for special characters.
Right now this is what we see:
Thank you
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:57 AM
Typesense does not apply any processing to the text during storage or during response. Can you please check the raw response returned from Typesense API?
Nima
Photo of md5-aaf4a8300f867ebf0c8d3e9f152943ee
Nima
06:12 AM
Is this way you mean?
Image 1 for Is this way you mean?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:13 AM
Yes, as you can see, the document data already contains those encoded characters. Typesense just returns that content directly.
Nima
Photo of md5-aaf4a8300f867ebf0c8d3e9f152943ee
Nima
06:22 AM
So the problem is escaping it in the Jekyll nav.yaml file then?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:26 AM
Yes, so the HTML entities have to be decoded before being indexed. Let me also find out if there's a way to do this automatically within the docsearch scraper.
Nima
Photo of md5-aaf4a8300f867ebf0c8d3e9f152943ee
Nima
06:59 AM
It’s strange but the ampersand is rendered correctly
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:30 AM
I will get back to you on this issue as well.
Nima
Photo of md5-aaf4a8300f867ebf0c8d3e9f152943ee
Nima
10:31 AM
thank you; I posted also to community just in case

1

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community