全文搜索和LIKE语句 [英] Full Text Search and LIKE statement

查看:162
本文介绍了全文搜索和LIKE语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GAE实验性全文搜索API是否提供SQLLIKE语句的替代方案?

谢谢!

解决方案

没有。 SQL 语句支持任意子字符串匹配 - 例如,abbatton将匹配bat - 而全文搜索实现全文索引,它使用规范化,词干和倒排索引来构建一个能够很好地回答用户倾向于查询的查询的索引输入文本文档。



如果您的意思是全文搜索API是否为SQL的LIKE运算符通常(错误)使用的替代方法,答案是是的 - 因为SQL的LIKE最常见的应用程序似乎是全文搜索,所以全文搜索API实际上比LIKE更适合这种情况,原因很多,包括效率('LIKE'需要扫描表的每一行),准确性(全文搜索提供排名,词干和其他功能),并消除误报(请参阅上面的示例)。

Does the GAE experimental Full Text Search API provide an alternative to the SQL "LIKE statement"?

Thanks!

解决方案

No. The SQL like statement supports arbitrary substring matching - for instance, "abbatton" will be a match for "bat" - while fulltext search implements full text indexing, which uses normalization, stemming, and an inverted index to construct an index that is good at answering the sort of queries users tend to enter for textual documents.

If you mean "does the Full Text search API provide an alternative for what SQL's LIKE operator is commonly (mis)used for", the answer is yes - since the most common application for SQL's LIKE appears to be fulltext search, the Full Text Search API is actually better suited to this than LIKE for a number of reasons, including efficiency ('LIKE' requires scanning every row of the table), accuracy (Full Text search provides ranking, stemming, and other features), and eliminating false positives (see the example above).

这篇关于全文搜索和LIKE语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆