about summary refs log tree commit diff stats
path: root/internal
diff options
context:
space:
mode:
authorAlan Pearce2024-05-16 21:00:35 +0200
committerAlan Pearce2024-05-16 21:00:35 +0200
commitd558039919b6198a246a6a3fd007276191cb4b2f (patch)
treee6c27f2d4c5091c5c525dcc6a124ce46320cf25c /internal
parent9b430ab18dc024058ea9c039fb64af0a3d5e3529 (diff)
downloadsearchix-d558039919b6198a246a6a3fd007276191cb4b2f.tar.lz
searchix-d558039919b6198a246a6a3fd007276191cb4b2f.tar.zst
searchix-d558039919b6198a246a6a3fd007276191cb4b2f.zip
fix: rebuild index when --replace is specified
Diffstat (limited to 'internal')
-rw-r--r--internal/index/indexer.go8
1 files changed, 4 insertions, 4 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)