Which Lucene is it?
Do you perhaps call commit() or flush() after every document (just a long
shot)?

On Sun, Jul 26, 2009 at 9:42 AM, Venkat Rangan <
venkat.ran...@clearwellsystems.com> wrote:

> Shai,
>
> Thanks for your response. There isn't any specific options I am setting
> and am leaving everything to defaults:
>
>        IndexWriter indexWriter = new
> IndexWriter(FSDirectory.getDirectory(stemIndexPath), new
> WhitespaceAnalyzer());
>        indexWriter.setMergeFactor(10);
>        indexWriter.setInfoStream(System.out);
>
> Documents are added using:
>
>        Document doc = new Document();
>        Field fld1 = new Field("fld1", "value1", Field.Store.NO,
> Field.Index.UN_TOKENIZED);
>        doc.add(fld1);
>        Field fld2 = new Field("fld2", "value2", Field.Store.YES,
> Field.Index.NO);
>        doc.add(fld2);
>        indexWriter.addDocument(doc);
>
> I added the following:
>
>        indexWriter.setMaxBufferedDocs(10);
>
> No difference - it continues to create one document in each RAM segment
> before the first merge.
>
> -venkat
>
> -----Original Message-----
> From: Shai Erera [mailto:ser...@gmail.com]
> Sent: Saturday, July 25, 2009 10:55 PM
> To: java-user@lucene.apache.org
> Subject: Re: Number of documents in each segment before a merge occurs
>
> How do you set up IndexWriter (can you paste the code here)?
> setMergeFactor
> just controls how often merges will occur. But there are other settings,
> like setRAMBufferSizeMB and setMaxBufferedDocs that control how often to
> create a segment. If for example you set maxBufferedDocs to 1, or
> RAMBufferSizeMB to a small value, such that each document fills the
> entire
> buffer, you'll run into the scenario you mentioned.
>
> If that's not the case, then it'd be good if you can paste here the
> indexing
> code including the IndexWriter setup, docs indexing etc.
>
> Shai
>
> On Sun, Jul 26, 2009 at 8:25 AM, Venkat Rangan <
> venkat.ran...@clearwellsystems.com> wrote:
>
> > Hi,
> >
> >
> >
> > We are writing to an index using IndexWriter with setMergeFactor() set
> > to 10. After inserting several documents, a merge occurs, but our
> > observation is that each segment only has a single document. Is there
> a
> > way to get more than a single document in each segment before they are
> > picked up for a merge?
> >
> >
> >
> > The following is the merge debug line when setInfoStream is set to
> > stdout stream.
> >
> >
> >
> > 2009-07-26 07:07:09,202 INFO  [STDOUT] (main:) merging segments _ram_0
> > (1 docs) _ram_1 (1 docs) _ram_2 (1 docs) _ram_3 (1 docs) _ram_4 (1
> docs)
> > _ram_5 (1 docs) _ram_6 (1 docs) _ram_7 (1 docs) _ram_8 (1 docs) _ram_9
> > (1 docs) into _0 (10 docs)
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Venkat Rangan
> >
> > Clearwell Systems Inc.
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>
>

Reply via email to