"Cool Coder" <[EMAIL PROTECTED]> wrote:
> Hi,
> I used have index refreshed in every 4 hr. However after each
> refresh, I can see two index. I am not sure how can I delete old
> index.
What do you mean by "you can see two index"?
> On starting of indexing process, I create Writer
> writer = new IndexWriter(luceneDirectory,false,luceneAnalyzer,true);
This is exactly right. That final true (which is the "create" arg) will
clear out the index.
> At the end of Indexing process:
> writer.flush();
> writer.close();
The writer.flush() isn't necessary: writer.close() will always flush.
> and reopen the indexreader
>
> luceneDirectory = FSDirectory.getDirectory(indexPath);
>
> reader = IndexReader.open(luceneDirectory);
> searcher = new IndexSearcher(reader);
> Is this the right way or I am missing something?
> Let me tell you that I dont want to update index rather I just want to
> delete the old index.
> Your help would be appreciated.
This looks right to me!
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]