You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ganesh <em...@yahoo.co.in> on 2008/10/20 12:08:13 UTC
Merge index will maintain index order
Hello all,
I am planning to merge two or more indexes. Once merged, will the DB
maintain the same index order as before merge?
I am doing sorting on Index Order as sorting on date-time takes more amount
of RAM. If i merge the index DB, will the same index order be maintained or
the indexes will be overlapped?
Regards
Ganesh
Send instant messages to your online friends http://in.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Merge index will maintain index order
Posted by Erick Erickson <er...@gmail.com>.
Let's claim you have build indexes in this order (by date).
index1
index2
index3
Now if you addindexes clause has them ordered the same way, then,
in the merged index, the first docID from index 2 will be greater than
the last doc id from index1 in the merged index. The first doc id from
index 3 will be greater than the last doc ID from index2.
But, if you ordered them as:
index2
index1
index3
in your addindexes statement, the first doc ID from index 1 will be greater
than the last doc ID from index2. etc.
But I'd recommend that you think carefully about whether you care
or not. Building your app such that it's sensitive to the ordering of
Lucene's internal document IDs should be done with care, and
only after you're absolutely sure that the other options don't work.
For instance, indexing a date field instead and sorting on that....
Best
Erick
On Mon, Oct 20, 2008 at 9:47 AM, mahdi yari <ya...@gmail.com> wrote:
> i can not understand about last sentence "So the final index will only ..."
> can you write more about this, because i have same question...
> thanks
>
> On Mon, Oct 20, 2008 at 2:04 PM, Michael McCandless <
> lucene@mikemccandless.com> wrote:
>
> >
> > By merge you mean using addIndexes*, right?
> >
> > Those methods logically concatenate the indices in order by doc ID. So
> the
> > original docs in your index will keep all their docIDs, and the newly
> added
> > indices are assigned docIDs after that, in the order they were added.
> >
> > So the final index will only be chronologically ordered by doc ID only if
> > the indexes you added were all ordered chronologically by docID, and
> after
> > all docs in the original index.
> >
> > Mike
> >
> >
> > Ganesh wrote:
> >
> > Hello all,
> >>
> >> I am planning to merge two or more indexes. Once merged, will the DB
> >> maintain the same index order as before merge?
> >> I am doing sorting on Index Order as sorting on date-time takes more
> >> amount of RAM. If i merge the index DB, will the same index order be
> >> maintained or the indexes will be overlapped?
> >>
> >> Regards
> >> Ganesh
> >>
> >> Send instant messages to your online friends
> >> http://in.messenger.yahoo.com
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
>
Re: Merge index will maintain index order
Posted by mahdi yari <ya...@gmail.com>.
i can not understand about last sentence "So the final index will only ..."
can you write more about this, because i have same question...
thanks
On Mon, Oct 20, 2008 at 2:04 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:
>
> By merge you mean using addIndexes*, right?
>
> Those methods logically concatenate the indices in order by doc ID. So the
> original docs in your index will keep all their docIDs, and the newly added
> indices are assigned docIDs after that, in the order they were added.
>
> So the final index will only be chronologically ordered by doc ID only if
> the indexes you added were all ordered chronologically by docID, and after
> all docs in the original index.
>
> Mike
>
>
> Ganesh wrote:
>
> Hello all,
>>
>> I am planning to merge two or more indexes. Once merged, will the DB
>> maintain the same index order as before merge?
>> I am doing sorting on Index Order as sorting on date-time takes more
>> amount of RAM. If i merge the index DB, will the same index order be
>> maintained or the indexes will be overlapped?
>>
>> Regards
>> Ganesh
>>
>> Send instant messages to your online friends
>> http://in.messenger.yahoo.com
>> ---------------------------------------------------------------------
>> 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
>
>
Re: Merge index will maintain index order
Posted by Michael McCandless <lu...@mikemccandless.com>.
By merge you mean using addIndexes*, right?
Those methods logically concatenate the indices in order by doc ID.
So the original docs in your index will keep all their docIDs, and the
newly added indices are assigned docIDs after that, in the order they
were added.
So the final index will only be chronologically ordered by doc ID only
if the indexes you added were all ordered chronologically by docID,
and after all docs in the original index.
Mike
Ganesh wrote:
> Hello all,
>
> I am planning to merge two or more indexes. Once merged, will the DB
> maintain the same index order as before merge?
> I am doing sorting on Index Order as sorting on date-time takes more
> amount of RAM. If i merge the index DB, will the same index order be
> maintained or the indexes will be overlapped?
>
> Regards
> Ganesh
>
> Send instant messages to your online friends http://in.messenger.yahoo.com
> ---------------------------------------------------------------------
> 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