about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--internal/index/indexer.go8
-rw-r--r--searchix.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/index/indexer.go b/internal/index/indexer.go
index 7141762..3665785 100644
--- a/internal/index/indexer.go
+++ b/internal/index/indexer.go
@@ -182,22 +182,22 @@ func OpenOrCreate(dataRoot string, force bool) (*ReadIndex, *WriteIndex, bool, e
 		if force {
 			err = deleteIndex(dataRoot)
 			if err != nil {
-				return nil, nil, exists, err
+				return nil, nil, false, err
 			}
 		}
 		idx, err = createIndex(indexPath)
 		if err != nil {
-			return nil, nil, exists, err
+			return nil, nil, false, err
 		}
 
 		meta, err = createMeta(metaPath)
 		if err != nil {
-			return nil, nil, exists, err
+			return nil, nil, false, err
 		}
 
 		err = meta.Save()
 		if err != nil {
-			return nil, nil, exists, err
+			return nil, nil, false, err
 		}
 	} else {
 		idx, err = bleve.Open(indexPath)
diff --git a/searchix.go b/searchix.go
index 9917969..59235cd 100644
--- a/searchix.go
+++ b/searchix.go
@@ -81,7 +81,7 @@ func main() {
 		log.Fatalf("Failed to open or create index: %v", err)
 	}
 
-	if !exists {
+	if !exists || *replace {
 		slog.Info("Index doesn't exist. Starting build job...")
 		err = importer.Start(cfg, write, *replace)
 		if err != nil {