search: turn on page rank for ranking search (#43786)

I am silly and forgot to enable page rank ranks! Additionally this
tweaks how much work a zoekt can do before it flushes. I think we had a
lot of poor results because in practice for a common search term we may
only look in 10 repos. We now make that 100, which should still be fine
w.r.t. memory use.

Test Plan: CI
This commit is contained in:
Keegan Carruthers-Smith 2022-11-02 11:03:40 +02:00 committed by GitHub
parent bb7785c170
commit d0e02b37db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,10 +113,11 @@ func (o *Options) ToSearch(ctx context.Context) *zoekt.SearchOptions {
// It is hard to think up general stats here based on limit. So
// instead we only run the ranking code path if the limit is
// reasonably small. This is fine while we experiment.
searchOpts.ShardMaxMatchCount = 1000
searchOpts.TotalMaxMatchCount = 10000
searchOpts.ShardMaxMatchCount = 1_000
searchOpts.TotalMaxMatchCount = 100_000
searchOpts.MaxDocDisplayCount = limit
searchOpts.FlushWallTime = 500 * time.Millisecond
searchOpts.UseDocumentRanks = true
return searchOpts
}