lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tate Avery" <>
Subject RE: Finding All?
Date Fri, 13 Aug 2004 19:36:11 GMT

I had to do this once and I put a field called "all" with a value of "true" for every document.

_doc.addField(Field.Keyword("all", "true"));

Then, if there was an empty query, I would substitute it for the query "all:true".  And, of
course, every doc would match this.

There might be a MUCH more elegant solution, but this certainly worked for me and was quite
easy to incorporate.  And, it appears to order the documents by the order in which they were


p.s. You can probably do something using IndexReader directly... but the nice thing about
this approach is that you are still just using a simple query.

-----Original Message-----
From: Patrick Burleson []
Sent: Friday, August 13, 2004 3:25 PM
To: Lucene Users List
Subject: Finding All?

Is there a way for lucene to find all documents? Say if I have a
search input and someone puts  nothing in I want to go ahead and
return everything. Passing "*" to QueryParser was not pretty.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message