How do you set mergeFactor on an IndexWriter object. I tried the way it
was mentioned in this
article(http://www.onjava.com/pub/a/onjava/2003/03/05/lucene.html)
writer.mergeFactor = 1000; 
This did not work for me. I tried setting the
org.apache.lucene.mergeFactor property. That worked for me. Lucene
created a new segment for every 1000 documents. Then I wanted to test
maxMergeDocs using setProperty. I set its value to 5000. With the
default maxMergeDocs when I have 10000 documents, Lucene merged the 10
segments into one large segment. I want to set the value to maxMergeDocs
to 5000 so I don't want lucene to do a merge when it has 10,000
documents. But that did not work. Can somebody explain how to set these
properties? 

Thanks in advance,
Ravi.   

-----Original Message-----
From: Luke Shannon [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 2:38 PM
To: Lucene Users List; [EMAIL PROTECTED]
Subject: Re: version documents

Thank you for the suggestion.

I ended up biting the bullet and re-working my indexing logic. Luckily
the system itself knows what the "current" version of a document is
(otherwise it won't know which one to display to the user) for any given
folder.

I was able to get a static method I could call passing in a folder name.
The method returns the file name of the current version for that folder.

Each time I am doing an incremental update if I find that a document
from a folder hasn't changed I make sure it is the current version
before moving on. If it isn't I remove it from the index.

Than when I am creating a new index or adding files to an existing, for
each file, I have to check the file I am adding to ensure it is the
current version for the folder before adding it.

As you can imagine this slows down indexing (creating a new or updating
an
existing) but it ensures content from an old version will never show up
in a query.

Luke

----- Original Message -----
From: "Yonik Seeley" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>; "Justin
Swanhart"
<[EMAIL PROTECTED]>
Sent: Thursday, November 18, 2004 1:32 PM
Subject: Re: version documents


> This won't fully work.  You still need to delete the
> original out of the lucene index to avoid it showing
> up in searches.
>
> Example:
> myfile v1:  "I want a cat"
> myfile v2:  "I want a dog"
>
> If you change "cat" to "dog" in myfile, and then do a
> search for "cat", you will *only* get v1 and hence the
> sort on version doesn't help.
>
> -Yonik
>
>
> --- Justin Swanhart <[EMAIL PROTECTED]> wrote:
> > Split the filename into "basefilename" and "version"
> > and make each a keyword.
> >
> > Sort your query by version descending, and only use
> > the first
> > "basefile" you encounter.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> 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]




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

Reply via email to