all repos — searchix @ 839cd807ccd1c2c2d4048c5a892af19b08e5270a

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

refactor: remove unused analyser
Alan Pearce alan@alanpearce.eu
Thu, 06 Mar 2025 21:47:16 +0100
commit

839cd807ccd1c2c2d4048c5a892af19b08e5270a

parent

fe71a5291da0f782812152a2f5e59a8841820a26

1 files changed, 1 insertions(+), 12 deletions(-)

jump to
M internal/index/indexer.gointernal/index/indexer.go
@@ -16,7 +16,6 @@ "go.alanpearce.eu/x/log" 	"go.uber.org/zap"
 
 	"github.com/blevesearch/bleve/v2"
-	"github.com/blevesearch/bleve/v2/analysis/analyzer/custom"
 	"github.com/blevesearch/bleve/v2/analysis/analyzer/keyword"
 	"github.com/blevesearch/bleve/v2/analysis/analyzer/simple"
 	"github.com/blevesearch/bleve/v2/analysis/analyzer/web"
@@ -57,17 +56,7 @@ descriptionFieldMapping := bleve.NewTextFieldMapping() 	descriptionFieldMapping.Store = false
 	descriptionFieldMapping.Analyzer = web.Name
 
-	err := indexMapping.AddCustomAnalyzer("option_name", map[string]interface{}{
-		"type":      custom.Name,
-		"tokenizer": letter.Name,
-		"token_filters": []string{
-			camelcase.Name,
-			porter.Name,
-		},
-	})
-	if err != nil {
-		return nil, errors.WithMessage(err, "could not add custom analyser")
-	}
+	var err error
 	err = indexMapping.AddCustomAnalyzer("loc", map[string]interface{}{
 		"type":      keyword.Name,
 		"tokenizer": letter.Name,