lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Document ids in Lucene index
Date Mon, 14 Apr 2008 22:12:16 GMT

: - check maxDoc()
: - iterate from 0 to maxDoc() and process doc if it is not deleted

For the record: that is exactly what MatchAllDocsQuery does ... except 
that you have an off by one error (maxDoc returns 1 more then the 
largest possible document number).

Even if you don't want the Query API, just use MatchAllDocs to handle the 
details for you and save yourself some code...

  Scorer allDocs = (new MatchAllDocs()).weight(searcher).scorer(reader);
  while ( {
    int doc = allDocs.doc() stuff..


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

View raw message