Lucene Query clause to always return true?
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
精彩评论