about summary refs log tree commit diff stats
path: root/internal/search
diff options
context:
space:
mode:
authorAlan Pearce2024-05-09 19:12:52 +0200
committerAlan Pearce2024-05-09 19:28:15 +0200
commitc72f8dc787379f6544739c5c57a8241a14f6d2a0 (patch)
treee3ef963dd526206b68fb3d1125bb0b7e6c0bcd51 /internal/search
parent3b379a13710cae2adc56131af1069e6fb92976b8 (diff)
downloadsearchix-c72f8dc787379f6544739c5c57a8241a14f6d2a0.tar.lz
searchix-c72f8dc787379f6544739c5c57a8241a14f6d2a0.tar.zst
searchix-c72f8dc787379f6544739c5c57a8241a14f6d2a0.zip
style: rename Option.Option to Option.Name
Diffstat (limited to 'internal/search')
-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
 			}