lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <DOR...@il.ibm.com>
Subject Re: Multiple segments
Date Thu, 08 Mar 2007 17:55:11 GMT
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" <Sachin.Kainth@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


Mime
View raw message