From 725be7993e1d8075c40750ff39157aa67f220c8a Mon Sep 17 00:00:00 2001 From: coolneng Date: Sun, 10 Jan 2021 19:55:43 +0100 Subject: [PATCH] Recreate the index each time --- src/main/java/org/RI/P2/Indexer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/RI/P2/Indexer.java b/src/main/java/org/RI/P2/Indexer.java index 494f5c4..2259f43 100644 --- a/src/main/java/org/RI/P2/Indexer.java +++ b/src/main/java/org/RI/P2/Indexer.java @@ -66,10 +66,10 @@ public class Indexer { return arrayObject; } - void openIndex() throws IOException { + void createIndex() throws IOException { Directory dir = FSDirectory.open(Paths.get(folderPath)); IndexWriterConfig config = new IndexWriterConfig(customAnalyzer); - config.setOpenMode(OpenMode.CREATE_OR_APPEND); + config.setOpenMode(OpenMode.CREATE); index = new IndexWriter(dir, config); }