Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 5.3.9104] Context: avoid panic on stopwords query (#62026) #62055

Merged
merged 2 commits into from
Apr 21, 2024

Conversation

jtibshirani
Copy link
Member

This backport folds together these two PRs, which together fix a bug around
queries containing only stopwords:

Test plan

Same test plan as original PRs

In #60106, we fixed a bug where the context search threw an error when the query
was composed entirely of stopwords. However, the queries were still returning
results (based on filename match). This means that for a stopwords-only query
like "what's going on?" we return a fairly random set of files, which confuses
the LLM.

Now we make sure to return an empty search, which returns no results.
In #61848, we tried to fix an issue when the query contained only stopwords and
we interpreted this as "match all files". Unfortunately this fix introduced a panic by
returning a nil search job, which is not allowed by the our job framework.

Now, we return a `noopJob` which returns no results. This is the same approach
we use when an AND/ OR query has no operands.
@cla-bot cla-bot bot added the cla-signed label Apr 19, 2024
@github-actions github-actions bot added team/product-platform team/search-platform Issues owned by the search platform team labels Apr 19, 2024
@jtibshirani jtibshirani requested a review from a team April 19, 2024 21:18
@keegancsmith keegancsmith merged commit 6033114 into 5.3.9104 Apr 21, 2024
12 checks passed
@keegancsmith keegancsmith deleted the jtibs/stopwords branch April 21, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed team/product-platform team/search-platform Issues owned by the search platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants