Apache Lucene(TM) is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.
Apache Lucene is an open source project available for free download. To know more about Lucene , click here.
In this example we will see how to append to an existing lucene index. We will see how we can update the existing index files with new data.
IndexWriter iwriter = new IndexWriter(directory, analyzer, false, MaxFieldLength.UNLIMITED);
Note the boolean variable - true to create the index or overwrite the existing one; false to append to the existing index. To know more about IndexWriter, see API.
About the example: We will create few text files. Then use our java program to create index and search. Then we will add a new file, update the index and search again.
First we will create few text files in a location lets say "C:\TestLucene\files"
Apache Lucene is an open source project available for free download. To know more about Lucene , click here.
In this example we will see how to append to an existing lucene index. We will see how we can update the existing index files with new data.
IndexWriter iwriter = new IndexWriter(directory, analyzer, false, MaxFieldLength.UNLIMITED);
Note the boolean variable - true to create the index or overwrite the existing one; false to append to the existing index. To know more about IndexWriter, see API.
About the example: We will create few text files. Then use our java program to create index and search. Then we will add a new file, update the index and search again.
First we will create few text files in a location lets say "C:\TestLucene\files"