Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lucene Query clause to always return true?

Tags:

lucene

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 "where 1=1", is there anything like this in Lucene? Or am I barking up the wrong tree?

like image 986
benhsu Avatar asked Oct 27 '25 08:10

benhsu


1 Answers

I think you are looking for MatchAllDocsQuery

like image 70
agent-j Avatar answered Oct 30 '25 14:10

agent-j



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!