diff options
Diffstat (limited to 'internal/search/search.go')
-rw-r--r-- | internal/search/search.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/search/search.go b/internal/search/search.go index bc77cea..357698c 100644 --- a/internal/search/search.go +++ b/internal/search/search.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/gob" + "path" "searchix/internal/options" "github.com/blevesearch/bleve/v2" @@ -27,7 +28,9 @@ type ReadIndex struct { index bleve.Index } -func Open(indexPath string) (*ReadIndex, error) { +func Open(dataRoot string) (*ReadIndex, error) { + indexPath := path.Join(dataRoot, indexBaseName) + idx, err := bleve.Open(indexPath) if err != nil { return nil, errors.WithMessagef(err, "unable to open index at path %s", indexPath) |