我想编写一个Lucene查询,它等效于以下SQL
where age = 25
and name in ("tom", "dick", "harry")
到目前为止,我想出的最好的方法是:
(age:25 name:tom) OR
(age:25 name:dick) OR
(age:25 name:harry)
有没有更简洁的方式写这个?
谢谢,
唐
最佳答案
age:25 AND name:(tom OR dick OR harry)
或者
+age:25 +name:(tom OR dick OR harry)
关于lucene - Lucene查询语法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1177968/