lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tate Avery" <tate.av...@nstein.com>
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
indexed.

T

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 [mailto:pburleson@gmail.com]
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.

Thanks,
Patrick

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message