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 "Kainth, Sachin" <Sa...@atkinsglobal.com> on 2007/03/08 17:37:27 UTC

Multiple segments

Hi all,

I have been performing some tests on index segments and have a problem.
I have read the file formats document on the official website and from
what I can see it should be possible to create as many segments for an
index as there are documents (though of course this is not a great
idea).  Having searched around it occurred to be that the way to do this
is to set maxMergeDocs to 1.  Having tried this I found that it doesn't
work.  All documents still get put into one segment.  Any idea what I
should do?

Thanks


This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to. 

Re: Multiple segments

Posted by Doron Cohen <DO...@il.ibm.com>.
margeDocs only limits the merging of "already saved segments" as result of
calling addDocument(). If there are added documents not yet "saved" but
rather still buffered in memory (by IndexWriter), once their number exceeds
maxBufferedDocs they are "saved", but as a single merged segment. So you
could set maxBufferedDocs to 2 (that's the minimal value) and maxMergedDocs
to 1 and add N documents to the index, - that would likely result in N/2
segments. You could probably force N segments by closing the index after
each add and reopen it before the next add. Note that while such settings
might be interesting for learning purposes, that would have an unpleasant
performance impact...  Last, calling optimize(), no matter what above
settings are, a single segment is created.

Regards,
Doron

"Kainth, Sachin" <Sa...@atkinsglobal.com> wrote on 08/03/2007
08:37:27:

> Hi all,
>
> I have been performing some tests on index segments and have a problem.
> I have read the file formats document on the official website and from
> what I can see it should be possible to create as many segments for an
> index as there are documents (though of course this is not a great
> idea).  Having searched around it occurred to be that the way to do this
> is to set maxMergeDocs to 1.  Having tried this I found that it doesn't
> work.  All documents still get put into one segment.  Any idea what I
> should do?
>
> Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org