SQLite3 FTS的坑

客户说,我的东西怎么搜索不到了?

zhanghd@ubuntu:~/sqlite/SQLite-036ebf72_orig_3.18.2$ ./sqlite3 vt.db
SQLite version 3.18.2 2017-06-17 09:59:36
Enter ".help" for usage hints.
sqlite> CREATE VIRTUAL TABLE vt USING fts4(n TEXT, c TEXT, n2 TEXT);
sqlite> insert into vt values('kiwi bird', '123 456 6789', 'dog');
sqlite> select n, c, n2 from vt where vt match 'n:cat* OR c:6789*';
kiwi bird|123 456 6789|dog
sqlite> select n, c, n2 from vt where vt match 'n:cat_* OR c:6789*';
sqlite> select n, c, n2 from vt where vt match 'c:6789* OR n:cat_*';
kiwi bird|123 456 6789|dog
zhanghd@ubuntu:~/sqlite/SQLite-036ebf72_orig_3.18.2$ ./sqlite3 vt.db 
SQLite version 3.18.2 2017-06-17 09:59:36
Enter ".help" for usage hints.
sqlite> CREATE VIRTUAL TABLE vt USING fts4(n TEXT, c TEXT, n2 TEXT, tokenize=icu);
sqlite> insert into vt values('kiwi bird', '123 456 6789', 'dog');
sqlite> select n, c, n2 from vt where vt match 'n:cat* OR c:6789*';
kiwi bird|123 456 6789|dog
sqlite> select n, c, n2 from vt where vt match 'n:cat_* OR c:6789*';
kiwi bird|123 456 6789|dog
sqlite> select n, c, n2 from vt where vt match 'c:6789* OR n:cat_*';
kiwi bird|123 456 6789|dog

SQLite3 FTS的坑_第1张图片

你可能感兴趣的:(SQLite3 FTS的坑)