about summary refs log tree commit diff stats
path: root/internal/server
diff options
context:
space:
mode:
authorAlan Pearce2024-05-09 18:47:37 +0200
committerAlan Pearce2024-05-09 19:28:13 +0200
commit0986e8699e87addccbef43c0ce30a466988fed15 (patch)
treefa40d9609b8764966c7c477fb91ef3c01113635d /internal/server
parent1db7c2a1630c3d80c3c696c8fabaa5476eb2184e (diff)
downloadsearchix-0986e8699e87addccbef43c0ce30a466988fed15.tar.lz
searchix-0986e8699e87addccbef43c0ce30a466988fed15.tar.zst
searchix-0986e8699e87addccbef43c0ce30a466988fed15.zip
feat: enable index path to be configured
Diffstat (limited to 'internal/server')
-rw-r--r--internal/server/server.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 1611a7a..8252b8e 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -45,6 +45,7 @@ type Config struct {
 	BaseURL       cfg.URL    `conf:"default:http://localhost:3000,short:b"`
 	ConfigFile    string     `conf:"short:c"`
 	LogLevel      slog.Level `conf:"default:INFO"`
+	IndexPath     string     `conf:"default:data/index.bleve"`
 }
 
 type HTTPError struct {
@@ -89,7 +90,7 @@ func New(runtimeConfig *Config) (*Server, error) {
 	}
 
 	slog.Debug("loading index")
-	index, err := search.Open(config.DataPath)
+	index, err := search.Open(runtimeConfig.IndexPath)
 	slog.Debug("loaded index")
 	if err != nil {
 		log.Fatalf("could not open search index, error: %#v", err)