feat: de-rank packages on 'all' search Implements: https://todo.sr.ht/~alanpearce/searchix/4
Alan Pearce alan@alanpearce.eu
Mon, 30 Dec 2024 19:04:56 +0100
1 files changed, 6 insertions(+), 0 deletions(-)
jump to
M internal/index/search.go → internal/index/search.go
@@ -148,6 +148,12 @@ if source != nil { query.AddMust( setField(bleve.NewTermQuery(source.Key), "Source"), ) + } else { + q := bleve.NewTermQuery("nixpkgs") + q.SetField("Source") + q.SetBoost(-100) + + query.AddShould(q) } // ...and boost it if it matches any of these