about summary refs log tree commit diff stats
path: root/internal/server
diff options
context:
space:
mode:
authorAlan Pearce2024-05-11 14:34:15 +0200
committerAlan Pearce2024-05-11 14:37:30 +0200
commit1aa991ae1f1a426424549c92060b204114c8b3c2 (patch)
tree59dc9e67d6b0c5604d9a70f52260ae7d85411e6f /internal/server
parent48423548f4718886d32a87ddd65d5ee2620fd8c8 (diff)
downloadsearchix-1aa991ae1f1a426424549c92060b204114c8b3c2.tar.lz
searchix-1aa991ae1f1a426424549c92060b204114c8b3c2.tar.zst
searchix-1aa991ae1f1a426424549c92060b204114c8b3c2.zip
refactor: deduce index path automatically from config.DataPath
Diffstat (limited to 'internal/server')
-rw-r--r--internal/server/server.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 0474e39..28b74b2 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -40,7 +40,6 @@ 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"`
 	SentryDSN     string
 }
 
@@ -87,7 +86,7 @@ func New(runtimeConfig *Config) (*Server, error) {
 	}
 
 	slog.Debug("loading index")
-	index, err := search.Open(runtimeConfig.IndexPath)
+	index, err := search.Open(config.DataPath)
 	slog.Debug("loaded index")
 	if err != nil {
 		log.Fatalf("could not open search index, error: %#v", err)