![](/img/trans.png)
[英]When implementing a text search on an SQLite database, when is it best to use full text search and when is using LIKE in the SELECT query best?
[英]best way for query full text search using table filter
我们要使用filter_table限制查询字符串。
输入查询示例:
best 2018 my_brand shoes
筛选表:
单词没有空格。
-------
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
-------
返回:
if input query have sub_word in filter table, return true else return false.
蛮力法会很慢,是否有解决此问题的最佳结构?
我使用ngram Analyzer进行弹性搜索解决了这个问题。 Ngram分析器的返回速度比SQL快得多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.