全文搜索 SQL 在 ios8 和 ios7 之间有不同的效果
Full Text Search SQL has different effect between ios8 and ios7
我已经使用“*”符号在 ios7 sqlite 上进行选择,效果是我想要的,但是 ios8 sqlite 不支持“*”并显示 "no result" .是FMDB问题还是ios8不支持“*”符号?
SQL(使用 FMDB):
db.executeStatements("create virtual table if not exists TABLE_1 using fts3(col_1,Result)")
db.executeQuery("SELECT * FROM TABLE_1 WHERE col_1 MATCH ?",withArgumentsInArray:["*A*"])
Table:
+==============================+
| Name: TABLE_1 |
+------------------------------+
| col_1 | Result |
+==============================+
| A | result 1 |
+------------------------------+
| B | result 2 |
+------------------------------+
| AAB | result 3 |
+------------------------------+
iOS 8 不支持"*A*"
,但支持"A*"
:
db.executeQuery("SELECT * FROM TABLE_1 WHERE col_1 MATCH ?",withArgumentsInArray:["A*"])
我已经使用“*”符号在 ios7 sqlite 上进行选择,效果是我想要的,但是 ios8 sqlite 不支持“*”并显示 "no result" .是FMDB问题还是ios8不支持“*”符号?
SQL(使用 FMDB):
db.executeStatements("create virtual table if not exists TABLE_1 using fts3(col_1,Result)")
db.executeQuery("SELECT * FROM TABLE_1 WHERE col_1 MATCH ?",withArgumentsInArray:["*A*"])
Table:
+==============================+
| Name: TABLE_1 |
+------------------------------+
| col_1 | Result |
+==============================+
| A | result 1 |
+------------------------------+
| B | result 2 |
+------------------------------+
| AAB | result 3 |
+------------------------------+
iOS 8 不支持"*A*"
,但支持"A*"
:
db.executeQuery("SELECT * FROM TABLE_1 WHERE col_1 MATCH ?",withArgumentsInArray:["A*"])