lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Document ids in Lucene index
Date Mon, 14 Apr 2008 03:26:17 GMT
Wojtek, yes, that's how you can loop through all docs in the index.

Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch

----- Original Message ----
From: Wojtek H <wojtekh2@gmail.com>
To: java-user@lucene.apache.org
Sent: Sunday, April 13, 2008 1:38:35 PM
Subject: Re: Document ids in Lucene index

Thank you for the answer. So it means that I can without any problems
iterate over index documents using this algoritm (I don't want to use
MatchAllQuery):

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

Am I right?
Best,
wojtek

2008/4/12, Chris Hostetter <hossman_lucene@fucit.org>:
>
>  : I am wondering if there are possible "holes" in set of index documents
>
> : ids. Being more specific - is it possible that there exist integer i
>  : between 0 and IndexReader.maxDoc() such that
>  : reader.document(i) == null
>  : and
>  : reader.isDeleted(i)==false
>
> : ???
>
>  That should not ever happen ... if it does, I would consider it a bug
>  until someone smarter then me explained why it isn't.
>
>  (minor nit: document(i) won't ever return null, if you call it on a
>  deleted docId you'll get an IllegalArgumentException)
>
>
>  -Hoss
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>  For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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





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


Mime
View raw message