about summary refs log tree commit diff stats
path: root/internal/search/search.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/search/search.go')
-rw-r--r--internal/search/search.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/search/search.go b/internal/search/search.go
index 357698c..829fefe 100644
--- a/internal/search/search.go
+++ b/internal/search/search.go
@@ -26,18 +26,26 @@ type Result struct {
 
 type ReadIndex struct {
 	index bleve.Index
+	meta  *IndexMeta
 }
 
 func Open(dataRoot string) (*ReadIndex, error) {
 	indexPath := path.Join(dataRoot, indexBaseName)
+	metaPath := path.Join(dataRoot, metaBaseName)
 
 	idx, err := bleve.Open(indexPath)
 	if err != nil {
 		return nil, errors.WithMessagef(err, "unable to open index at path %s", indexPath)
 	}
 
+	meta, err := openMeta(metaPath)
+	if err != nil {
+		return nil, errors.WithMessagef(err, "unable to open metadata at path %s", metaPath)
+	}
+
 	return &ReadIndex{
 		idx,
+		meta,
 	}, nil
 }