lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gauri Shankar" <>
Subject Re: how to get the programmatic control over index's document id
Date Thu, 14 Feb 2008 11:59:48 GMT
Thanks a lot for both of you.

yes, I am talking about internally assigned document id.

Erick : I am already using the unique id into the index mapped to one of our
DB's primary key to uniquely identify the docs from index.  Now to get the
value of this unique field i need to call getDocumet(). But when the
resultset is too large than this step is very slow as I am calling
getDocument for each hit. Now I am using the FIELDCACHE and that has
improved a lot. But I am thinking If I can find a way so that docId can be
my unique ids and that will super optimize our search.
Any suggestions??

Gauri Shankar

On Sat, Feb 9, 2008 at 9:10 PM, Erick Erickson <>

> If you're referring to the internally-assigned document id, I don't think
> there is a way. Assuming you're trying to assign one yourself or some
> such.
> From all the discussions I've seen, I don't think there's even a faint
> possibility that controlling this will be added to Lucene. Note that
> existing IDs change as your index changes.
> Why do you care? What problem are you trying to solve? One common
> suggestion is to create your own field (as Patrick suggests) that contains
> your own unique ID. Using TermEnum/TermDocs will give you efficient
> ways of going from your unique ID to a docID...
> Best
> Erick
> On Feb 9, 2008 7:38 AM, Gauri Shankar <> wrote:
> > Hi,
> >
> > I would like to get the control over the docId field from my code. Can
> > anyone suggest some way for doing the same?
> >
> >
> > --
> > Warm Regards,
> > Gauri Shankar
> >

Warm Regards,
Gauri Shankar

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message