Thanks Yonik,
I can't set the merge factor too high because I will end up with the too many 
files open problem.

I have got this method from indexReader.java

  public static boolean isLocked(Directory directory) throws IOException {
    return
            directory.makeLock(IndexWriter.WRITE_LOCK_NAME).isLocked() ||
            directory.makeLock(IndexWriter.COMMIT_LOCK_NAME).isLocked();
  }

if I change this method to only check for 
directory.makeLock(IndexWriter.COMMIT_LOCK_NAME).isLocked(); will this tell me 
that a index is merging?

-----Original Message-----
From: Yonik Seeley [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 02, 2006 3:53 PM
To: java-user@lucene.apache.org
Subject: Re: index merging


No, there isn't anything in the API to tell you that.
A merge may be triggered on any IndexWriter.add() call.

If you want to avoid merges, you can set the merge factor really high
so that merges will never happen, and set maxBufferedDocs to the size
of the segments you want.

-Yonik

On 2/2/06, Omar Didi <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  I am trying to index in 2 different indexes with different mergefactors. so 
> if one of the indexes is merging than I want to index only on the other index.
> is there a way to know if an index is merging?.
>
> thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to