lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: how to get all documents in the results ?
Date Tue, 22 Mar 2011 10:40:52 GMT
Not sure what your use case actually is, but it sounds like you may be unclear how Lucene works.

Each query clause you have will produce an iterator that walks over the documents that match
that clause.  All the documents from the entire, root query get scored.  The scoring evaluation
per document is also related to the form of your query expression hierarchy.

So, MatchAllDocsQuery is exactly what you want if you want a document iterator that includes
all documents in the index.  You can change how this is scored by extending MatchAllDocsQuery
and writing a custom scorer.


-----Original Message-----
From: ext Patrick Diviacco [] 
Sent: Tuesday, March 22, 2011 4:23 AM
Subject: how to get all documents in the results ?

I'm using the following code because I want to see the entire collection in
my query results:

//adding wildcards-term to see all results
rest = new TermQuery(new Term("*","*"));
booleanQuery.add(rest, BooleanClause.Occur.SHOULD);

But it doesn't work, I only see the relevant docs and not all the other
How can I get all documents ordered by relevance instead ?

ps. MatchAllDocsQuery is not a solution because I need to specify my own
custom query.

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

View raw message