Full Text Search and LIKE statement

旧街凉风 提交于 2019-12-19 10:29:43

问题


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

Thanks!


回答1:


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).



来源:https://stackoverflow.com/questions/10790093/full-text-search-and-like-statement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!