问题描述
我有我的本地机器上的伟大工程以下SQLite的查询:
I have the following SQLite query which works great on my local machine:
SELECT * FROM ftdata WHERE ftdata MATCH 'phrase1:this AND phrase2:that'
这似乎并没有回到我的Android设备上相同的结果集,作为它我的桌面上。它返回在Android远不结果。该查询似乎返回两个正确的结果:
This doesn't seem to return the same resultset on my Android device as it does on my desktop. It returns far less results on Android. This query appears to return the correct results on both:
SELECT * FROM ftdata WHERE ftdata MATCH 'phrase1:this phrase2:that'
不过,我想理想情况下结合AND和OR查询,而不是被迫使用AND。
However I would ideally like to combine AND and OR queries instead of being forced to use AND.
是否有Android不支持增强的查询语法的某些功能?我使用了不正确的语法一审?
Are there certain features of the enhanced query syntax that Android doesn't support? Am I using the incorrect syntax in the first instance?
推荐答案
不同的Android固件使用的,但FTS的语法没有改变很长一段时间。
Different Android firmwares use different SQLite versions, but the FTS syntax has not changed for a long time.
您的问题是,大多数(所有?)的Android厂商不启用增强的查询语法。
Your problem is that most (all?) Android vendors do not enable the enhanced query syntax.
您应该限制自己与两种语法工作查询。
另外,执行来检查是否 ENABLE_FTS3_PARENTHESIS
设置。
You should restrict yourself to queries that work with both syntaxes.Alternatively, execute PRAGMA compile_options to check whether ENABLE_FTS3_PARENTHESIS
is set.
这篇关于在Android的SQLite增强的查询语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!