java-user@lucene.apache.org
[Top] [All Lists]

Re: Document ids in Lucene index

Subject: Re: Document ids in Lucene index
From: Otis Gospodnetic
Date: Sun, 13 Apr 2008 20:26:17 -0700 PDT
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@xxxxxxxxx>
To: java-user@xxxxxxxxxxxxxxxxx
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@xxxxxxxxx>:
>
>  : 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@xxxxxxxxxxxxxxxxx
>  For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx





---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>