为什么这个lucene查询字符串是错误的?

为什么这个lucene查询字符串是错误的?,lucene,Lucene,当我想查询我的lucene索引时,我发现了一个问题: +(title:a^4.0) +((+type:restaurant +city:CA) (-type:restaurant)) 我只是想限制结果,城市不是CA,类型是餐馆 但是lucene给了我一个结果: +(+type:restaurant +city:CA) and ignore (-type:restaurant ) 你能告诉我出了什么问题吗?虽然我没有得到你想要的,但你可能在问布尔Lucene查询语法。我相信我能帮助你

当我想查询我的lucene索引时,我发现了一个问题:

+(title:a^4.0) +((+type:restaurant +city:CA)  (-type:restaurant))
我只是想限制结果,城市不是CA,类型是餐馆

但是lucene给了我一个结果:

 +(+type:restaurant +city:CA) and ignore (-type:restaurant )

你能告诉我出了什么问题吗?

虽然我没有得到你想要的,但你可能在问布尔Lucene查询语法。我相信我能帮助你