简体   繁体   中英

best way for query full text search using table filter

we want restrict query string using filter_table.

input query example :

best 2018 my_brand shoes

filter table :

words did not have white space.

-------
filter_table
-------
brand <- query has this word so return true
my_brand<- query has it but we did not consider it.
your_brand
....
last_brand
-------

return :

if input query have sub_word in filter table, return true else return false.

Brute force method will be very slow, Is there any best structure for this problem?

I solved this using elastic search with ngram analyzer. Ngram analyzer return is very faster than SQL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM