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 Mon, 11 Dec 2006 19:04:27 GMT

if you are trying to think of Lucene's docid as a meaningful number, you
are doing something wrong.

A lot of people want to view Lucene docids the same way they look at
auto-incrimented unique keys in a database -- don't do that.  Instead
think of them as memory addresses in C or C++ ... they are a handy
numberic value that tells Lucene at what offset in various segment files
it can find data about that document -- as your index changes, as data
gets moved arround, docids change.

the best corrallary that can be made to a database is not auto-generated
unique keys, it's row numbers ... the physical row number of where that
row is in the sequence of rows in your table -- a number most databases
never give you access to unless you are dealing withthe low level
internals of hte table, because as you add or deleted lots of data, as you
drop and load new indexes those numbers can change.

if you want control of a unique ID for each of hte documents in your index
-- at one as a field just like any other.



: Date: Mon, 11 Dec 2006 17:10:18 +0100
: From: Ramana Jelda <ramana.jelda@ciao-group.com>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: RE: Lucene id generation
:
: I really lack this feature from lucene too.
: Whatever the requirements from Mohammed, There surely I see some
: improvements in search performance.
:
: My argument here is, why not lucene provides a mechanism to be able to
: provide custom document ids?
:
:
: > -----Original Message-----
: > From: Find Me [mailto:findmath@gmail.com]
: > Sent: Monday, December 11, 2006 4:34 PM
: > To: java-user@lucene.apache.org
: > Subject: Re: Lucene id generation
: >
: > On 12/11/06, Waheed Mohammed <waheed.mohammed@fiz-technik.de> wrote:
: > >
: > > Hello,
: > >
: > > Is there a way to influence lucene's generation of ids
: > while indexing.
: > >
: > > my requirement is. I want to have different indexes where no index
: > > should have ids that have been assigned to an index earlier.
: > > for instance
: > > IDX1 : {0.........100}
: > > IDX2: {101.......200}
: > > IDX3: {201.......300}
: > > but not
: > > IDX1 : {0.........100}
: > > IDX2 : {0.........100}
: > > IDX3 : {0.........100}
: >
: >
: > I dont think you should be doing that. If you want to have
: > the same effect,
: > during searching you can package hits from different indices with a
: > predetermined offset for each index. For ex: IDX1 will have
: > an offset 0,
: > IDX2 will have 101...and so on.
: >
: > --Rajesh Munavalli
: >
:
:
: ---------------------------------------------------------------------
: 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