Recreate the index each time
This commit is contained in:
parent
4e7c880b93
commit
725be7993e
|
@ -66,10 +66,10 @@ public class Indexer {
|
||||||
return arrayObject;
|
return arrayObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
void openIndex() throws IOException {
|
void createIndex() throws IOException {
|
||||||
Directory dir = FSDirectory.open(Paths.get(folderPath));
|
Directory dir = FSDirectory.open(Paths.get(folderPath));
|
||||||
IndexWriterConfig config = new IndexWriterConfig(customAnalyzer);
|
IndexWriterConfig config = new IndexWriterConfig(customAnalyzer);
|
||||||
config.setOpenMode(OpenMode.CREATE_OR_APPEND);
|
config.setOpenMode(OpenMode.CREATE);
|
||||||
index = new IndexWriter(dir, config);
|
index = new IndexWriter(dir, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue