about summary refs log tree commit diff stats
path: root/internal/search/indexer.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/search/indexer.go')
-rw-r--r--internal/search/indexer.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/search/indexer.go b/internal/search/indexer.go
index ad891ff..0ff041f 100644
--- a/internal/search/indexer.go
+++ b/internal/search/indexer.go
@@ -122,7 +122,7 @@ func NewIndexer(indexPath string, force bool) (*WriteIndex, error) {
 
 	optionMapping := bleve.NewDocumentStaticMapping()
 
-	optionMapping.AddFieldMappingsAt("Option", keywordFieldMapping)
+	optionMapping.AddFieldMappingsAt("Name", keywordFieldMapping)
 	optionMapping.AddFieldMappingsAt("Source", keywordFieldMapping)
 	optionMapping.AddFieldMappingsAt("Loc", locFieldMapping)
 	optionMapping.AddFieldMappingsAt("RelatedPackages", textFieldMapping)
@@ -165,10 +165,10 @@ func (i *WriteIndex) ImportOptions(
 			default:
 			}
 
-			doc := document.NewDocument(opt.Source + "/" + opt.Option)
+			doc := document.NewDocument(opt.Source + "/" + opt.Name)
 			err = i.indexMapping.MapDocument(doc, opt)
 			if err != nil {
-				errs <- errors.WithMessagef(err, "could not map document for option: %s", opt.Option)
+				errs <- errors.WithMessagef(err, "could not map document for option: %s", opt.Name)
 
 				continue
 			}
@@ -184,11 +184,11 @@ func (i *WriteIndex) ImportOptions(
 			field := document.NewTextFieldWithIndexingOptions("_data", nil, data.Bytes(), index.StoreField)
 			newDoc := doc.AddField(field)
 
-			// slog.Debug("adding option to index", "name", opt.Option)
+			// slog.Debug("adding option to index", "name", opt.Name)
 			err = batch.IndexAdvanced(newDoc)
 
 			if err != nil {
-				errs <- errors.WithMessagef(err, "could not index option %s", opt.Option)
+				errs <- errors.WithMessagef(err, "could not index option %s", opt.Name)
 
 				continue
 			}