Skip to content

search: document keyword search#55

Merged
jtibshirani merged 5 commits into
mainfrom
document-keyword-search
Jan 25, 2024
Merged

search: document keyword search#55
jtibshirani merged 5 commits into
mainfrom
document-keyword-search

Conversation

@stefanhengl

@stefanhengl stefanhengl commented Jan 23, 2024

Copy link
Copy Markdown
Member

Relates to https://github.com/sourcegraph/sourcegraph/pull/59779

With 5.3, keyword search will be the new default. Users can toggle between keyword search and standard search.

@vercel

vercel Bot commented Jan 23, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sourcegraph-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 25, 2024 6:23pm

@MaedahBatool

Copy link
Copy Markdown
Contributor

Hey @stefanhengl should this PR be shipped on Feb 15th?

@jtibshirani

Copy link
Copy Markdown
Contributor

@MaedahBatool yes indeed, this documents a search language change we're shipping in 5.3 (https://github.com/sourcegraph/sourcegraph/issues/58815).

@MaedahBatool MaedahBatool marked this pull request as draft January 24, 2024 17:14
@MaedahBatool

Copy link
Copy Markdown
Contributor

@MaedahBatool yes indeed, this documents a search language change we're shipping in 5.3 (sourcegraph/sourcegraph#58815).

Thanks @jtibshirani let's make this PR a draft so we don't merge it accidently.

@jtibshirani

Copy link
Copy Markdown
Contributor

@MaedahBatool can you explain why we wouldn't want to merge the PR? Is there a docs freeze at the moment?

@MaedahBatool

Copy link
Copy Markdown
Contributor

@MaedahBatool can you explain why we wouldn't want to merge the PR? Is there a docs freeze at the moment?

No docs freeze but have we shipped Sourcegraph 5.3? An early docs release might confuse our readers for a feature change that hasn't shipped so far.

@jtibshirani

jtibshirani commented Jan 24, 2024

Copy link
Copy Markdown
Contributor

@MaedahBatool and I caught up offline, and I explained the importance of merging these docs before the release so that we can (1) start to link to them from the UI, and (2) use our usual PR workflow to review and iterate on the docs. So I'm taking this out of draft mode now.

@jtibshirani jtibshirani marked this pull request as ready for review January 24, 2024 20:57

@jtibshirani jtibshirani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to view a preview, but the text looks good to me! I left a few comments.

Comment thread docs/code_search/reference/queries.mdx Outdated
| [`/foo.*bar/`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+/foo.*bar/&patternType=keyword) | Match the **regular expression** `foo.*bar`. We support [RE2 syntax](https://golang.org/s/re2syntax). |
| [`foo OR bar`](https://sourcegraph.com/search?q=context:global+foo+OR+bar&patternType=keyword) | Match documents containing `foo` _or_ `bar` anywhere in the document. |

Matching is case-insensitive (toggle the `Aa` button to change).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Matching is case-insensitive (toggle the `Aa` button to change).
Matching is case-insensitive by default (toggle the `Aa` button to change).

Comment thread docs/code_search/reference/queries.mdx Outdated
### Keyword search (default)

Standard search matches literal patterns exactly, including puncutation like quotes. Specify regular expressions inside `/./code_search/reference`.
<Callout type="note" title="Experimental">New in version 5.3: Keyword search is in the experimental stage and enabled by default. Site administrators can disable keyword search globally by setting `experimentalFeatures.keywordSearch: false` in site settings. Users can override the setting in their user settings.</Callout>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we decided on calling this 'beta' instead of 'experimental'. Looking at our docs for what experimental features mean, it doesn't seem like a good fit -- experimental features have limited support, have to be explicitly enabled, etc.

Comment thread docs/code_search/reference/queries.mdx Outdated
Standard search matches literal patterns exactly, including puncutation like quotes. Specify regular expressions inside `/./code_search/reference`.
<Callout type="note" title="Experimental">New in version 5.3: Keyword search is in the experimental stage and enabled by default. Site administrators can disable keyword search globally by setting `experimentalFeatures.keywordSearch: false` in site settings. Users can override the setting in their user settings.</Callout>

Keyword search matches individual terms anywhere in the document or the filename. Specify regular expressions inside `/.../`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add a line about exact matching using quotes before the line on regular expressions, since this is a key piece of syntax.

Comment thread docs/code_search/reference/queries.mdx Outdated

### Standard search

<Callout type="note" title="Experimental">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be confusing to have an experimental (or beta) badge next to Standard search. Maybe we can remove this badge and just include the info about the toggle in the Keyword search callout above?

@MaedahBatool

Copy link
Copy Markdown
Contributor

I wasn't able to view a preview, but the text looks good to me! I left a few comments.

You can view the preview at this link: https://sourcegraph-docs-v2-git-document-ke-010214-sourcegraph-f8c71130.vercel.app/docs

@jtibshirani

Copy link
Copy Markdown
Contributor

I just noticed something else to address: we use the term 'keyword' in these docs to mean 'filter name': https://sourcegraph.com/docs/code_search/reference/queries#keywords-all-searches. I think we need to update the terminology there to distinguish it from "keyword search". In general, it's unusual to call these "keywords" in the search context, they're usually called "filters".

@jtibshirani

Copy link
Copy Markdown
Contributor

@stefanhengl the changes look good! Did you see my comment above?

I just noticed something else to address: we use the term 'keyword' in these docs to mean 'filter name': https://sourcegraph.com/docs/code_search/reference/queries#keywords-all-searches. I think we need to update the terminology there to distinguish it from "keyword search". In general, it's unusual to call these "keywords" in the search context, they're usually called "filters".

@stefanhengl

stefanhengl commented Jan 25, 2024

Copy link
Copy Markdown
Member Author

Sorry I had to force push, but a lot of files were moved around/deleted in the meantime and it was much easier to just do it from scratch. On top comes the change from @jtibshirani's comment

@jtibshirani jtibshirani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing that! I think it's a lot clearer now.

Comment thread docs/admin/enterprise_getting_started_guide/index.mdx
@jtibshirani

Copy link
Copy Markdown
Contributor

Merging now to avoid running into more conflicts!

@jtibshirani jtibshirani merged commit 9d90267 into main Jan 25, 2024
@jtibshirani jtibshirani deleted the document-keyword-search branch January 25, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants