lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philipp Nanz" <phili...@gmail.com>
Subject Re: I need the internal lucene's document id from Hits
Date Thu, 05 Apr 2007 11:53:39 GMT
As long as there are no deletions, the ids will remain unchanged and
it is safe to use them outside.

But in a case where you delete some document, the resulting gap in the
document list will be filled during the next optimize (triggered
manually) or merge operation (may be triggered automatically on adding
a document), which means all following documents are shifted one
position and their ids change respectively.

2007/4/5, Mohammad Norouzi <mnrz57@gmail.com>:
> Thanks Philipp
>
>
> > 2007/4/5, Philipp Nanz <philippn@gmail.com>:
> > > That *is* the actual id in the index. There is no other.
> > > You should be careful using it outside of Lucene though, because
> > > Lucene may rearrange the document ids during optimization for example.
> > >
> > > If you need an application id, add it as an additional stored field to
> > > each document and retrieve that.
> > >
> >
>
> but the question is, if I add, say, a document to my index, is lucene going
> to re arrange the internal IDs? can't I trust them?
> Would you tell me in exactly which situation or action they will rearrange
> the IDs?
>
>
> --
> Regards,
> Mohammad
>

---------------------------------------------------------------------
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