开发者

Lucene Query clause to always return true?

开发者 https://www.devze.com 2023-03-19 11:36 出处:网络
Is there a Lucene clause to always return true? I am building my queries programmatically, and I believe it\'ll be useful if I can insert a clause which will always evaluate to true for any document.

Is there a Lucene clause to always return true? I am building my queries programmatically, and I believe it'll be useful if I can insert a clause which will always evaluate to true for any document. For example, I might be matching field foo against a list of values, and I want to say "if values is empty, then select all the documents". In SQL I can use "whe开发者_JAVA技巧re 1=1", is there anything like this in Lucene? Or am I barking up the wrong tree?


I think you are looking for MatchAllDocsQuery

0

精彩评论

暂无评论...
验证码 换一张
取 消