···3838 "time"
39394040 "github.com/bmatcuk/doublestar"
4141- "github.com/sourcegraph/zoekt"
4242- "github.com/sourcegraph/zoekt/ctags"
4341 "github.com/grafana/regexp"
4442 "github.com/rs/xid"
4543 "gopkg.in/natefinch/lumberjack.v2"
4444+4545+ "github.com/sourcegraph/zoekt"
4646+ "github.com/sourcegraph/zoekt/ctags"
4647)
47484849var DefaultDir = filepath.Join(os.Getenv("HOME"), ".zoekt")
···870871 rank []float64
871872}
872873874874+// rank returns a vector of scores which is used at index-time to sort documents
875875+// before writing them to disk. The order of documents in the shard is important
876876+// at query time, because earlier documents receive a boost at query time and
877877+// have a higher chance of being searched before limits kick in.
873878func rank(d *zoekt.Document, origIdx int) []float64 {
874879 generated := 0.0
875880 if strings.HasSuffix(d.Name, "min.js") || strings.HasSuffix(d.Name, "js.map") {
···897902 // Prefer docs that are not tests
898903 test,
899904905905+ // With short names
906906+ squashRange(len(d.Name)),
907907+900908 // With many symbols
901909 1.0 - squashRange(len(d.Symbols)),
902910903911 // With short content
904912 squashRange(len(d.Content)),
905905-906906- // With short names
907907- squashRange(len(d.Name)),
908913909914 // That is present is as many branches as possible
910915 1.0 - squashRange(len(d.Branches)),