External content in FTS4 SQLITE

白昼怎懂夜的黑 提交于 2019-12-07 12:05:19

问题


I have a VIEW view_for_search_unit and a FTS4 table FTS_table_search_unit. I inserted data from view_for_search_unit into the FTS table using this command:

INSERT INTO FTS_table_search_unit(docId, name, description)
SELECT id, name, description FROM view_for_search_unit

After I check data in FTS table using this:

SELECT *FROM FTS_table_search_unit

it has 1000 perfect records(I use fake data). However, when I use the MATCH function in FTS:

SELECT * FROM FTS_table_search_unit WHERE FTS_table_search_unit MATCH 's*'

I retrieve 1000 records but all columns in the result are NULL. What is the problem? I can't understand because there is data in FTS_table_search_unit.


回答1:


Try docid instead of *:

SELECT docid FROM FTS_table_search_unit 
WHERE FTS_table_search_unit 
MATCH 's*'

or

SELECT v.* FROM FTS_table_search_unit s
INNER JOIN view_for_search_unit v ON s.docid = v.id
WHERE FTS_table_search_unit MATCH 's*';


来源:https://stackoverflow.com/questions/29159424/external-content-in-fts4-sqlite

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