feat!: use plurals for document IDs and URLs
4 files changed, 20 insertions(+), 6 deletions(-)
M internal/index/meta/meta.go → internal/index/meta/meta.go
@@ -12,7 +12,7 @@ "github.com/Southclaws/fault/fmsg" ) const ( - CurrentSchemaVersion = 9 + CurrentSchemaVersion = 10 BaseName = "meta.json" )
M internal/nix/importable.go → internal/nix/importable.go
@@ -7,17 +7,18 @@ "alin.ovh/searchix/internal/config" ) type Importable interface { + ImporterType() string BleveType() string GetName() string GetSource() string } func GetKey(i Importable) string { - return i.BleveType() + "/" + i.GetSource() + "/" + i.GetName() + return i.ImporterType() + "/" + i.GetSource() + "/" + i.GetName() } func MakeKey(source config.Source, id string) string { - return source.Importer.Singular() + "/" + source.Key + "/" + id + return source.Importer.String() + "/" + source.Key + "/" + id } func init() {
M internal/nix/option.go → internal/nix/option.go
@@ -7,6 +7,7 @@ "github.com/Southclaws/fault" "github.com/yuin/goldmark" + "alin.ovh/searchix/internal/config" "alin.ovh/searchix/internal/nixdocs" )@@ -37,7 +38,11 @@ ImportedAt time.Time } func (Option) BleveType() string { - return "option" + return config.Options.Singular() +} + +func (Option) ImporterType() string { + return config.Options.String() } func (p Option) GetName() string {
M internal/nix/package.go → internal/nix/package.go
@@ -1,6 +1,10 @@ package nix -import "time" +import ( + "time" + + "alin.ovh/searchix/internal/config" +) type Package struct { Name string@@ -35,7 +39,11 @@ Name string } func (Package) BleveType() string { - return "package" + return config.Packages.Singular() +} + +func (Package) ImporterType() string { + return config.Packages.String() } func (p Package) GetName() string {