reindexer icon indicating copy to clipboard operation
reindexer copied to clipboard

Incorrect work of full-text search when using synonym with an extra word

Open ilyamaksimov1991 opened this issue 4 years ago • 1 comments

We have 3 products with the name: 1.защитное стекло для экрана samsung galaxy 2.защитное стекло для экрана apple iphone 3.защитное стекло для экрана xiaomi • we have a synonym "бронестекло => защитное стекло" upon request SELECT , COUNT() FROM products WHERE search_products = '@name +бронестекло' I get all 3 items. But if I add another word, there will be errors: SELECT , COUNT() FROM products WHERE search_products = '@name +бронестекло +iphone' I expect to get only the second product, but I get all three. SELECT , COUNT() FROM products WHERE search_products = '@name +бронестекло +samsung' I expect to see only the first product, but displays all three products SELECT , COUNT() FROM products WHERE search_products = '@name +бронестекло +xiaomi' I expect only the third product, but displays all three. SELECT , COUNT() FROM products WHERE search_products = '@name +бронестекло +something +not +in +the +title' I expect a blank search, but all three products are displayed

type Product struct { Id string reindex:"id" json:"id" SpaceId string reindex:"space_id" json:"space_id" Name string reindex:"name,tree" json:"name" _ struct{} reindex:"name+brand=search_products,text,composite" _ struct{} reindex:"id+space_id,,composite,pk" } products := []Product{ { Id: "1", SpaceId: "msk_cl", Name: "защитное стекло для экрана samsung galaxy", }, { Id: "2", SpaceId: "msk_cl", Name: "защитное стекло для экрана apple iphone", }, { Id: "3", SpaceId: "msk_cl", Name: "защитное стекло для экрана xiaomi", }, }

ilyamaksimov1991 avatar Sep 24 '20 14:09 ilyamaksimov1991

thanks for the solved problem, but there are new problems with multi-word synonyms

https://github.com/Restream/reindexer/issues/68

ilyamaksimov1991 avatar Feb 12 '21 09:02 ilyamaksimov1991