Thanks guys, that helped a lot.
Saurabh
On Sat, Jul 16, 2011 at 3:08 PM, Mihai Caraman wrote:
> >
> > indexWriter = new IndexWriter(FSDirectory.open(new File(indexDirName)),
> > getAnalyzer(), true, MaxFieldLength.UNLIMITED);
> >
> > Does this statement cleans up existing index files?
>
> yes
>
>
> indexWriter = new IndexWriter(FSDirectory.open(new File(indexDirName)),
> getAnalyzer(), true, MaxFieldLength.UNLIMITED);
>
> Does this statement cleans up existing index files?
yes
> If yes, then how do I
> tackle a scenario where lets say I brought down my application server
> hosting code
My advice: Don't close the IndexWriter - just call commit. Don't worry about
forcing merges - let them happen as they do when you call commit.
If you are going to use the IndexWriter again, you generally do not want to
close it. Calling commit is the preferred option.
- Mark Miller
lucidimagina
Hi Eric
Thanks for the reply.
*Index Code:*
Here is the code snippet that I am using for creating index writer.
indexWriter = new IndexWriter(FSDirectory.open(new File(indexDirName)),
getAnalyzer(), true, MaxFieldLength.UNLIMITED);
Does this statement cleans up existing index files? If yes, th