lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject RE: Lucene id generation
Date Sat, 16 Dec 2006 08:56:08 GMT

: Exactly in this scenario, I would love to use my custom generated document
: id.
: The array reference number is MyId & its value is some-interested-value
: matched to MyID.
:
: So,how can I generate custom document id.?

you can't .. you can index you custom "MyID" value and use the FieldCache
to look it up -- using the lucene docid.

That's what Karl is refering to: he uses the lucene docid as the *index*
in the array, and his MyId values are *stored* in the array.


: > -----Original Message-----
: > From: Chris Hostetter [mailto:hossman_lucene@fucit.org]
: > Sent: Friday, December 15, 2006 6:35 AM
: > To: java-user@lucene.apache.org
: > Subject: Re: Lucene id generation
: >
: >
: > Karl: it sounds like you are just refering to using the
: > lucene docid as an array index for the FieldCache of your
: > "MyID" field ... that's a perfectly valid use of the docid,
: > the key being that you aren't expecting the id to contain any
: > meaningful data itself -- it's just a refrence number.
: >
: > : > if you are trying to think of Lucene's docid as a meaningful
: > : > number, you
: > : > are doing something wrong.
: > :
: > : There is this one place where I use it. The index is add only, and
: > : the only data that interests me is the stored field MyID, also kept
: > : track in an int[docid]. In case of index operation that
: > change docid,
: > : I simply repopulate the int[].
: > :
: > : I throw this MyID value around quite a bit, starting in the hit
: > : collector. It save me time from deserializing all hits.
: > :
: > : Is this reasonable?
: >
: >
: >
: > -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
:



-Hoss


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