Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ilyamaksimov1991 opened this issue Sep 24, 2020 · 1 comment

Comments

@ilyamaksimov1991
Copy link

ilyamaksimov1991 commented Sep 24, 2020

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 ilyamaksimov1991 changed the title Некорректная работа полнотекстового поиска при использовании синонима в связке с дополнительным словом Incorrect work of full-text search when using synonym with an extra word Sep 24, 2020
@ilyamaksimov1991
Copy link
Author

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

#68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant