feat: prioritise exact matches on programs/attr/name field
Alan Pearce alan@alanpearce.eu
Thu, 06 Mar 2025 21:57:01 +0100
1 files changed, 3 insertions(+), 0 deletions(-)
jump to
M internal/index/search.go → internal/index/search.go
@@ -161,14 +161,17 @@ } programsQuery := bleve.NewMatchQuery(keyword) programsQuery.SetField("Programs") + programsQuery.SetBoost(2) query.AddShould(programsQuery) attrQuery := bleve.NewMatchQuery(keyword) attrQuery.SetField("Attribute") + attrQuery.SetBoost(2) query.AddShould(attrQuery) nameLiteralQuery := bleve.NewMatchQuery(keyword) nameLiteralQuery.SetField("Name") + nameLiteralQuery.SetBoost(2) query.AddShould(nameLiteralQuery) search := bleve.NewSearchRequest(query)