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

search: content filter implies searching only file content#43442

Merged
rvantonder merged 1 commit into
mainfrom
backend-integration/rvt/content-filter-3
Oct 26, 2022
Merged

search: content filter implies searching only file content#43442
rvantonder merged 1 commit into
mainfrom
backend-integration/rvt/content-filter-3

Conversation

@rvantonder

Copy link
Copy Markdown
Contributor

If a query specifies content: explicitly then we'll search only content if no type is set (previously we would search path, repo, and content, since content: was treated as if it were a pattern). This was a paper cut from a while ago, and more recently in feedback https://sourcegraph.slack.com/archives/C03CSAER9LK/p1666369025491439

This is a small change in behavior, if users previously relied on content:"path with spaces" to try and search for paths without using path, they will no longer see results (but that was a confusing/buggy/unintended behavior anyway, so the meaning is now more clear with content).

Test plan

Added tests.

@cla-bot cla-bot Bot added the cla-signed label Oct 25, 2022
@rvantonder rvantonder requested a review from tbliu98 October 25, 2022 19:52
@sourcegraph-bot

sourcegraph-bot commented Oct 25, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 12a6727...b2d3ff7.

Notify File(s)
@beyang internal/search/job/jobutil/job.go
internal/search/job/jobutil/job_test.go
internal/search/job/jobutil/testdata/Test_computeResultTypes/only_search_file_content_when_type_not_set.golden
internal/search/job/jobutil/testdata/Test_computeResultTypes/plain_pattern_searches_repo_path_file_content.golden
@camdencheek internal/search/job/jobutil/job.go
internal/search/job/jobutil/job_test.go
internal/search/job/jobutil/testdata/Test_computeResultTypes/only_search_file_content_when_type_not_set.golden
internal/search/job/jobutil/testdata/Test_computeResultTypes/plain_pattern_searches_repo_path_file_content.golden
@keegancsmith internal/search/job/jobutil/job.go
internal/search/job/jobutil/job_test.go
internal/search/job/jobutil/testdata/Test_computeResultTypes/only_search_file_content_when_type_not_set.golden
internal/search/job/jobutil/testdata/Test_computeResultTypes/plain_pattern_searches_repo_path_file_content.golden

@rvantonder rvantonder requested a review from novoselrok October 25, 2022 19:56
@rvantonder rvantonder force-pushed the backend-integration/rvt/content-filter-3 branch from 1267920 to 71ab402 Compare October 25, 2022 20:16
@rvantonder rvantonder force-pushed the backend-integration/rvt/content-filter-2 branch from 0584f1c to 65243e6 Compare October 25, 2022 20:59
Base automatically changed from backend-integration/rvt/content-filter-2 to main October 25, 2022 21:20
@rvantonder rvantonder force-pushed the backend-integration/rvt/content-filter-3 branch from a0d7efb to 8a5dca3 Compare October 25, 2022 21:20
@rvantonder rvantonder force-pushed the backend-integration/rvt/content-filter-3 branch from 8a5dca3 to b2d3ff7 Compare October 25, 2022 21:21
@rvantonder rvantonder merged commit 47cddc1 into main Oct 26, 2022
@rvantonder rvantonder deleted the backend-integration/rvt/content-filter-3 branch October 26, 2022 00:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants