all repos — searchix @ 0986e8699e87addccbef43c0ce30a466988fed15

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: enable index path to be configured

Alan Pearce
commit

0986e8699e87addccbef43c0ce30a466988fed15

parent

1db7c2a1630c3d80c3c696c8fabaa5476eb2184e

1 file changed, 1 insertion(+), 5 deletions(-)

changed files
M internal/search/search.gointernal/search/search.go
@@ -4,7 +4,6 @@ import (
"bytes" "context" "encoding/gob" - "path" "searchix/internal/options" "github.com/blevesearch/bleve/v2"
@@ -13,7 +12,6 @@ "github.com/pkg/errors"
) const ResultsPerPage = 20 -const indexFilename = "index.bleve" type DocumentMatch struct { search.DocumentMatch
@@ -29,9 +27,7 @@ type ReadIndex struct {
index bleve.Index } -func Open(dir string) (*ReadIndex, error) { - indexPath := path.Join(dir, indexFilename) - +func Open(indexPath string) (*ReadIndex, error) { idx, err := bleve.Open(indexPath) if err != nil { return nil, errors.WithMessagef(err, "unable to open index at path %s", indexPath)