Handling Special Characters in Typesense Queries
TLDR Jack had an issue with Typesense returning all results when querying with special characters. Jason indicated that Typesense removes special characters, suggesting a modification in the
symbols_to_index setting. Jack found a solution by implementing a client-side filter for special characters only queries.
Oct 17, 2023 (1 month ago)
@), I seem to get all results back when I'd actually expect no results (none of my documents contain an
@). Is there an option to disable this behaviour? We depend on there being some highlight information in the results, but when searching for special characters we don't get any highlight data back (as the result doesn't actually match the query).
q=@will actually translate to
You want to add
symbols_to_indexsetting when creating the collection, to change this behavior
symbols_to_indexas none of my results have
@in them (and I'd have to do it for every other special character too!) - ideally if a query consists entirely of non-indexed symbols then it should return nothing, but I understand treating it as
*. I'll implement something on our client-side to not send a query if it only consists of special characters.
Indexed 3015 threads (79% resolved)
Querying with Special Characters in Collections
Hariharan asked about querying with special characters. Kishore Nallan explained to use `symbols_to_index` configuration while creating the collection.
Handling Special Characters in Search Queries
Sidharth asks how to handle special characters in search queries. Kishore Nallan suggests using `symbols_to_index` configuration and provides an example to help.
Typesense Username Search Issue with Dashes or Underscores
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.