Search in sources :

Example 1 with KeywordAnalyzer

use of org.apache.lucene.analysis.KeywordAnalyzer in project exhibitor by soabase.

the class IndexBuilder method open.

public void open() throws Exception {
    if (!directory.exists() && !directory.mkdirs()) {
        throw new IOException("Could not make: " + directory);
    }
    IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_35, new KeywordAnalyzer()).setOpenMode(IndexWriterConfig.OpenMode.CREATE);
    niofsDirectory = new NIOFSDirectory(directory, new SingleInstanceLockFactory());
    writer = new IndexWriter(niofsDirectory, conf);
}
Also used : KeywordAnalyzer(org.apache.lucene.analysis.KeywordAnalyzer) NIOFSDirectory(org.apache.lucene.store.NIOFSDirectory) IndexWriter(org.apache.lucene.index.IndexWriter) IOException(java.io.IOException) SingleInstanceLockFactory(org.apache.lucene.store.SingleInstanceLockFactory) IndexWriterConfig(org.apache.lucene.index.IndexWriterConfig)

Aggregations

IOException (java.io.IOException)1 KeywordAnalyzer (org.apache.lucene.analysis.KeywordAnalyzer)1 IndexWriter (org.apache.lucene.index.IndexWriter)1 IndexWriterConfig (org.apache.lucene.index.IndexWriterConfig)1 NIOFSDirectory (org.apache.lucene.store.NIOFSDirectory)1 SingleInstanceLockFactory (org.apache.lucene.store.SingleInstanceLockFactory)1