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
Index files should not be disappearing unless you're using the form
of opening an indexwriter that creates a new index. We'd need to see
the code you use top open the IW to provide more help.
If all you're doing is looking at the index directory, segments will disappear
as they are merged so that'