Answer the question
In order to leave comments, you need to log in
FullText MySQL word sequence search?
Good evening.
Tell me how to correctly write FullText search for a sequence of characters.
Searching in the text:
Electric lawn mower WORTEX LM 3213-1 P petrol
query
text
:
LM32131P
LM 32131P
LM 3213
1P P41T NX.EFTER.006 15"(Intel Pentium Quad Core N5000 1.1 GHz 4 GB)
request text:
31 P41T EX215
P41T EX215 31
EX215-NX-31-P41T - such a request should not be found in the text because not all words will be stand next to each other
So far I use such queries, but they do not find all the necessary results and can find extra ones that are not needed:
SELECT * FROM products WHERE MATCH(ProductName) AGAINST('"LM 3213 1 P"' IN BOOLEAN MODE);
Or to search for all words like this:
SELECT * FROM products WHERE MATCH(ProductName) AGAINST('+EX215 +31 +P41T' IN BOOLEAN MODE);
Answer the question
In order to leave comments, you need to log in
I don't know how suitable Mysql is in this case. Why not take Solr/Sphinx search engines?
In any case, the product model is difficult to find. It would rather be worth looking for by the Levenshtein algorithm. But the name of the product should be well found by search engines.
The name of the product is primary, and the model is of secondary importance when searching for products in the store.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question