google / zoekt

Fast trigram based code search
1.7k stars 113 forks source link

improve performance for content searches #122

Closed stefanhengl closed 3 years ago

stefanhengl commented 3 years ago

For content searches trying to match multiple terms on the same line, we check whether the matches of the individual terms intersect before calling the regex engine. If they don't intersect, we skip the document.

This optimization is useful whenever terms of the query appear often in the same document but rarely on the same line.

google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

stefanhengl commented 3 years ago

I close this PR and push the change to Gerrit instead.