#community-help

Configuring Exact Search Matches and Usage of Separators in Typesense

TLDR Ivan needed help with obtaining exact matches on Typesense. Jason suggested to turn off prefix matches and Kishore Nallan advised using separators config. They helped Ivan understand searching via variations and the upcoming "space as typo" feature.

Powered by Struct AI

1

15
25mo
Solved
Join the chat
Dec 13, 2021 (25 months ago)
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
04:35 PM
Hi  Jason  Kishore Nallan, we are using algolia angular instantsearch via TypesenseInstantSearchAdapter.
In our collection we have facet field "uri", i am trying to find exact match "estg-9" in this field, but instead i get results like "estg-91", "estg-92","estg-9a", etc. Is there any way to get exact matches?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:36 PM
You want to turn off prefix matches for this field
04:37
Jason
04:37 PM
This table has more info about the prefix parameter: https://typesense.org/docs/0.22.1/api/documents.html#arguments
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
04:39 PM
Thank you, will try
Dec 14, 2021 (25 months ago)
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
09:39 AM
Hi Jason Kishore Nallan,your advice helped me, also i have question:
I have uri like: "estg-9" , and now with turned off prefix i can find this exact match entering "estg-9", but how can i configure search to also find this "estg-9" by entering for example "9 estg" or "estg 9" ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:50 AM
You have to use the separators config in collection schema to add - as a separator.

1

Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
09:51 AM
Ok, thank you!
Dec 20, 2021 (25 months ago)
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
12:00 PM
Hi Kishore Nallan Jason we added "-" as separator, now when i want to find "estg-9" and i typing "estg 9" or "9 estg" i don't get this exact match, instead i get matched tokens like "9" or "9)". We search by several attributes, not only uri, is there any way to make query search for whole sentense and not to search by separate words?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:02 PM
We have implemented the "space as typo" feature in a rc beta build, which is what you need here. estg 9 should become estg9 for searching (however, 9estg will not work since will be order dependent).
12:03
Kishore Nallan
12:03 PM
If you wish to support all these variations, you can index them as an array, like this: ["estg-9", "estg9", "9estg"] etc.
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
12:05 PM
Thank you
01:17
Ivan
01:17 PM
Kishore Nallan one more question: what's the time plan for releasing 0.23 version with this "space as typo" feature?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:18 PM
We've a beta build for you to test if you want. We generally take a call on release date only when we feel we have enough features/bug fixes to warrant a release.
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
01:22 PM
Ok, thanks for answer🙂
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:26 PM
Let me know if you use Docker/Linux and I can share an appropriate build for testing.

Typesense

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

Indexed 3011 threads (79% resolved)

Join Our Community

Similar Threads

Issues with Repeated Words and Hyphen Queries in Typesense API

JinW discusses issues with repeated word queries and hyphen-containing queries in Typesense. Kishore Nallan offers possible solutions. During the discussion, Mr seeks advice on `token_separators` and how to send custom headers. Issues remain with repeated word queries.

8

43
25mo

Troubleshooting Issues with DocSearch Hits and Scraper Configuration

Rubai encountered issues with search result priorities and ellipsis. Jason helped debug the issue and suggested using different versions of typesense-docsearch.js, updating initialization parameters, and running the scraper on a Linux-based environment. The issues related to hits structure and scraper configuration were resolved.

7

131
8mo
Solved

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.

6

111
8mo
Solved

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.

3

48
19mo

Resolving Issues with Infix and Prefix in Query Searches

Daren struggled with searches missing values in production. Jason and Kishore Nallan offered insights and created new features to help solve the problem, which was then tested and deployed by Daren.

2

38
5mo
Solved