Skip to content

search: Add support for unindexed structural search

Administrator requested to merge master-dry-run/cc/rip-out-ripgrep into main

Created by: camdencheek

This adds support for searching unindexed revisions with a structural search.

Fixes #8164

General flow:

  • Frontend sends searcher a repo/revision to search with indexed == false
  • Searcher retrieves a zip of that revision from gitserver or from its cache
  • filteredStructuralSearch runs the zip through a regexSearch with a regex-ified version of the structural pattern
  • Comby is run against the list of paths in the zip that have candidate matches for the structural pattern
  • The matches are returned

Performance-wise, this is considerably better than the PR it's replacing (#17928). For a structural search against an unindexed sourcegraph/sourcegraph, it took 0.1 seconds vs 1 second. For a search against torvalds/linux it was more like 1 second vs 20 seconds. The vast majority of the improvement seems to have come from not having to unzip the revision before searching it. In any case, this does still deal with bad cold start times for large repos.

Merge request reports

Loading