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

Configure Feed

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

Only set FileMatch.Ranks if UseDocumentRanks is true (#466)

We don't need to set this data if we are not using it for ranking.

+4 -1
+3
api.go
··· 39 39 // Experimental. Ranks is a vector containing floats in the interval [0, 1]. The 40 40 // length of the vector depends on the output from the ranking function at index 41 41 // time. 42 + // 43 + // This field is only set if the shard contains ranking information and 44 + // SearchOptions.UseDocumentRanks is true. 42 45 Ranks []float64 43 46 44 47 // For debugging. Needs DebugScore set, but public so tests in
+1 -1
eval.go
··· 370 370 // Prefer earlier docs. 371 371 fileMatch.addScore("doc-order", scoreFileOrderFactor*(1.0-float64(nextDoc)/float64(len(d.boundaries))), opts.DebugScore) 372 372 373 - if len(d.ranks) > int(nextDoc) { 373 + if opts.UseDocumentRanks && len(d.ranks) > int(nextDoc) { 374 374 fileMatch.Ranks = d.ranks[nextDoc] 375 375 } 376 376