···1818 "bytes"
1919 "fmt"
2020 "log"
2121- "os"
2221 "path"
2322 "sort"
2423 "strings"
···10031002 sort.Sort(chunkMatchScoreSlice(ms))
10041003}
1005100410061006-var doNovelty = os.Getenv("ZOEKT_NOVELTY_DISABLE") == ""
10071007-10081005// SortFiles sorts files matches in the order we want to present results to
10091006// users. The order depends on the match score, which includes both
10101007// query-dependent signals like word overlap, and file-only signals like the
···10151012func SortFiles(ms []FileMatch) {
10161013 sort.Sort(fileMatchesByScore(ms))
1017101410181018- if doNovelty {
10191019- // Experimentally boost something into the third filematch
10201020- boostNovelExtension(ms, 2, 0.9)
10211021- }
10151015+ // Boost a file extension not in the top 3 to the third filematch.
10161016+ boostNovelExtension(ms, 2, 0.9)
10221017}
1023101810241019func boostNovelExtension(ms []FileMatch, boostOffset int, minScoreRatio float64) {