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

Context: return no results for stopwords query#61848

Merged
jtibshirani merged 1 commit into
mainfrom
jtibs/stopwords
Apr 12, 2024
Merged

Context: return no results for stopwords query#61848
jtibshirani merged 1 commit into
mainfrom
jtibs/stopwords

Conversation

@jtibshirani

@jtibshirani jtibshirani commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

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.

Test plan

Added a new unit test. Tested Cody web locally.

@cla-bot cla-bot Bot added the cla-signed label Apr 12, 2024
@github-actions github-actions Bot added team/product-platform team/search-platform Issues owned by the search platform team labels Apr 12, 2024
@jtibshirani

Copy link
Copy Markdown
Contributor Author

Another bug I found playing around with patterntype:codycontext in the search bar. Here's what results used to look like:
Screenshot 2024-04-12 at 1 37 22 PM

@jtibshirani jtibshirani marked this pull request as ready for review April 12, 2024 21:00
@jtibshirani jtibshirani merged commit eba4df7 into main Apr 12, 2024
@jtibshirani jtibshirani deleted the jtibs/stopwords branch April 12, 2024 21:53
jtibshirani added a commit that referenced this pull request Apr 19, 2024
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.
jtibshirani added a commit that referenced this pull request Apr 19, 2024
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.
jtibshirani added a commit that referenced this pull request Apr 19, 2024
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.
keegancsmith pushed a commit that referenced this pull request Apr 21, 2024
…62055)

* Context: return no results for stopwords query (#61848)

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.

* Context: avoid panic on stopwords query (#62026)

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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

2 participants