#community-help

Typesense Username Search Issue with Dashes or Underscores

TLDR Jonathan had issues with searching for usernames with dashes or underscores in Typesense. Kishore Nallan advised using the symbols_to_index parameter to index special characters.

Powered by Struct AI
3
8mo
Solved
Join the chat
Jan 05, 2023 (8 months ago)
Jonathan
Photo of md5-bffc880aaf1403298b3f01fa86a873d8
Jonathan
03:30 AM
Hi! I’m trying to create a username searcher with typesense.

However, it seems when I type in dashes or underscores, typesense doesn’t filter down the results at all. How can I change this behavior? Ideally, when i type in a dash, it should show only results where a dash is in the field.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
03:58 AM
Typesense by default does not index any special characters.

If you want to index and make "-" searchable, take a look at the symbols_to_index param here: https://typesense.org/docs/0.23.1/api/collections.html#schema-parameters
Jan 06, 2023 (8 months ago)
Jonathan
Photo of md5-bffc880aaf1403298b3f01fa86a873d8
Jonathan
11:38 PM
thank you!