#community-help

Troubleshooting Prefix Search and Exact Match Results in Typesense v0.22.0.rcs24

TLDR JinW has trouble with typesense search, notably with prefix search and exact matches. Jason clarified some things while Kishore Nallan requested more examples and suggested using a different software version. Harisaran also recommended a solution.

Powered by Struct AI

1

Nov 27, 2021 (24 months ago)
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
04:39 PM
Currently, I find that I have to do this to return better results for typos and exact match. If I enable prefix then exact match normally don’t come back at all. v0.22.0.rcs24
'query_by'  => 'title,title',
'prefix' => 'true,false',
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:42 PM
Could you share an example of a search query, expected results, actual results and the search parameters you’re using?
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
04:46 PM
Let me put something together. Would turn set prefix to false disable typos?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:18 PM
It shouldn’t…
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
05:23 PM
A good example would be “extracur” for “extracurricular”. If I disable the prefix then it won’t return it.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:50 PM
That’s expected. Turning off prefix search means that you only want full word matches to be returned and not partial prefix matches
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
06:27 PM
I think I found the issue or a hack. When searching for the song Fall in Love (without “in” stop words and prefix=true). It will return anything else with Love except for Fall in Love and I think this may due to the drop token. It works if I just reverse the query string to Love In Fall
07:01
JinW
07:01 PM
Also, does the words order in the query matter?
Nov 28, 2021 (23 months ago)
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:33 PM
JinW Would you be able to provide a simple reproduceable example that show cases this issue? For e.g. an example where you can provide me with a few records and a sample query that returns unexpected data?

Also, I fixed an issue related to prefix + dropping of tokens, so you might also want to try using typesense/typesense:0.22.0.rcs40 first which contains that fix.
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
07:02 PM
Thank you, will do. First let me figure out if this issue related to the https://github.com/typesense/typesense-go library or not.
07:09
JinW
07:09 PM
I think there is something wrong with the typesense-go library. The git commit that use [email protected] to generate return the correct search results. While all the latest commits(used opa-codegen > v1.5.0) return really weird results and random highlighted text that not part of the query. I have not tested with recs40 yet. Version > v.1.5.0 changed the c.RequestEditor to c.RequestEditors to handle multiple []RequestEditorFn

commit 04a84132cd41900ff8fba033898ba6296095a6a5 (HEAD -> master, origin/master, origin/HEAD)
Author: Khalil Sarwari &lt;<mailto:kha[email protected]|[email protected]>&gt;
Date: Wed Oct 13 05:39:35 2021 -0700
07:18
JinW
07:18 PM
Kishore Nallan Do you have the link for linux for rcs40?
07:25
Jason
07:25 PM
re: go library, could you open an issue in the repo?
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
07:53 PM
Jason Do you have the one with tar.gz instead? I don’t use Ubuntu
Nov 29, 2021 (23 months ago)
Harisaran
Photo of md5-b0606ff89d86624d6908bd3c51445af5
Harisaran
05:50 AM
Hey JinW Can you try current master ?
go get 
Nov 30, 2021 (23 months ago)
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
01:27 AM
Harisaran I have not tried with the latest v0.22.0.rcs40 but I did have issue with the typesense-go@master