用户反映app文本查询很慢
确实做程序的时候 也没多想 偷懒啦
文本查询 就一行接一行 做 indexOf 查询 比较慢。
不要自己开发全文检索啦(嘿嘿 不会)
网上找了android全文检索的资料
主要是SQLite和android 支持
http://www.v2ex.com/2008/11/22/full-text-search/
http://bakhtiyor.com/2009/08/sqlite-full-text-search/
Make sure you use MATCH instead of equals or LIKE to scan a TEXT column in a virtual table.
回头修改 哈哈
PS 某牛 发表的回复 中文支持不是太好
FTS3 needs to be hacked to support splitting chinese texts.
确实做程序的时候 也没多想 偷懒啦
文本查询 就一行接一行 做 indexOf 查询 比较慢。
不要自己开发全文检索啦(嘿嘿 不会)
网上找了android全文检索的资料
主要是SQLite和android 支持
http://www.v2ex.com/2008/11/22/full-text-search/
http://bakhtiyor.com/2009/08/sqlite-full-text-search/
SQLite contains full-text search module called FTS3, using this module you can easily add fast full text search to an Android application.
First you need to create virtual table:
1.
CREATE VIRTUAL TABLE TableName
2.
USING FTS3(ColOne TEXT, ColTwo DATETIME)
Your table must contains at least 1 TEXT field.
The FTS3 virtual table acts like a regular table, but you need to manually maintain the indexes to keep referential integrity — you should UPDATE the FTS3 table from time to time.
The full-text query in SQLite looks like this:
1.
SELECT * FROM TableName WHERE ColOne MATCH 'search phrase'
回头修改 哈哈
PS 某牛 发表的回复 中文支持不是太好
FTS3 needs to be hacked to support splitting chinese texts.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/86970/viewspace-622856/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/86970/viewspace-622856/