例如,如果我有这些记录
单词
AAA
AAB
AAC
呸呸呸
对于普通表,我会使用 sql 之类的
select * from table where word like 'AA%'order by H collate nocase asc
我如何使用 FTS3 表进行选择?另外我想知道FTS3在这种查询下是否仍然比普通表有更好的性能?
我如何使用 FTS3 表进行选择?
引用文档:
可以查询 FTS 表中包含指定术语的所有文档(上述简单情况),或包含具有指定前缀的术语的所有文档。正如我们所见,特定术语的查询表达式就是术语本身。用于搜索术语前缀的查询表达式是前缀本身,并附加了一个“*”字符。
该文档还提供了一个示例:
-- Query for all documents containing a term with the prefix "lin". This will match
-- all documents that contain "linux", but also those that contain terms "linear",
--"linker", "linguistic" and so on.
SELECT * FROM docs WHERE docs MATCH 'lin*';