all repos — searchix @ ff283282d42ec5f77e9ad8f2c5616e4315b0355e

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

feat!: use plurals for document IDs and URLs

Alan Pearce
commit

ff283282d42ec5f77e9ad8f2c5616e4315b0355e

parent

0fcfb0252f229d00b426b171ddcd0fb1f1213063

M internal/index/meta/meta.gointernal/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.gointernal/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.gointernal/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.gointernal/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 {