Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

search: Predicates require a large count to ensure correct results #19688

@camdencheek

Description

@camdencheek

The way predicates currently work, they require that we execute them with a large count value to ensure that we are not missing valid results.

Consider repo:contains.commit.after(1 year ago) file:super_rare_file.go count:1

First, repo:contains.commit.after(1 year ago) is expanded to a list of repo names using the query repohascommitafter:"1 year ago" select:repo count:99999. If we don't add that extra count parameter, we may not return the only repo that contains super_rare_file.go, and our original search may return no results.

However, if there are many repos that have new commits, we may be doing significantly more work than if we'd inverted the search to something like repo:contains(file:super_rare_file.go) repohascommitafter:"1 year ago" count:1. By filtering to our rare predicate first, we drastically reduce the amount of work that is done.

Somehow, we should figure out a way to smartly limit the number of results for predicates. One way of doing this would be to retry with a higher count if we didn't hit our outer limit.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions