fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

score: remove ZOEKT_NOVELTY_DISABLE (#718)

This has been running for three months and we haven't found a need to
disable it.

Test Plan: go test ./...

+2 -7
+2 -7
contentprovider.go
··· 18 18 "bytes" 19 19 "fmt" 20 20 "log" 21 - "os" 22 21 "path" 23 22 "sort" 24 23 "strings" ··· 1003 1002 sort.Sort(chunkMatchScoreSlice(ms)) 1004 1003 } 1005 1004 1006 - var doNovelty = os.Getenv("ZOEKT_NOVELTY_DISABLE") == "" 1007 - 1008 1005 // SortFiles sorts files matches in the order we want to present results to 1009 1006 // users. The order depends on the match score, which includes both 1010 1007 // query-dependent signals like word overlap, and file-only signals like the ··· 1015 1012 func SortFiles(ms []FileMatch) { 1016 1013 sort.Sort(fileMatchesByScore(ms)) 1017 1014 1018 - if doNovelty { 1019 - // Experimentally boost something into the third filematch 1020 - boostNovelExtension(ms, 2, 0.9) 1021 - } 1015 + // Boost a file extension not in the top 3 to the third filematch. 1016 + boostNovelExtension(ms, 2, 0.9) 1022 1017 } 1023 1018 1024 1019 func boostNovelExtension(ms []FileMatch, boostOffset int, minScoreRatio float64) {