You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* generate protobuf types
* stream poc over SSE
* wip: make stream search api follow existing schema. Modify UI to support streaming
* fix scrolling issue
* Dockerfile
* wip on lezer parser grammar for query language
* add lezer tree -> grpc transformer
* remove spammy log message
* fix syntax highlighting by adding a module resolution for @lezer/common
* further wip on query language
* Add case sensitivity and regexp toggles
* Improved type safety / cleanup for query lang
* support search contexts
* update Dockerfile with query langauge package
* fix filter
* Add skeletons to filter panel when search is streaming
* add client side caching
* improved cancelation handling
* add isSearchExausted flag for flagging when a search captured all results
* Add back posthog search_finished event
* remove zoekt tenant enforcement
* migrate blocking search over to grpc. Centralize everything in searchApi
* branch handling
* plumb file weburl
* add repo_sets filter for repositories a user has access to
* refactor a bunch of stuff + add support for passing in Query IR to search api
* refactor
* dev README
* wip on better error handling
* error handling for stream path
* update mcp
* changelog wip
* type fix
* style
* Support rev:* wildcard
* changelog
* changelog nit
* feedback
* fix build
* update docs and remove uneeded test file
Copy file name to clipboardExpand all lines: CHANGELOG.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
<!-- Bump @sourcebot/mcp since there are breaking changes to the api in this release -->
11
+
10
12
### Added
13
+
- Added support for streaming code search results. [#623](https://github.com/sourcebot-dev/sourcebot/pull/623)
14
+
- Added buttons to toggle case sensitivity and regex patterns. [#623](https://github.com/sourcebot-dev/sourcebot/pull/623)
11
15
- Added counts to members, requets, and invites tabs in the members settings. [#621](https://github.com/sourcebot-dev/sourcebot/pull/621)
12
16
17
+
### Changed
18
+
- Changed the default search behaviour to match patterns as substrings and **not** regular expressions. Regular expressions can be used by toggling the regex button in search bar. [#623](https://github.com/sourcebot-dev/sourcebot/pull/623)
19
+
- Renamed `public` query prefix to `visibility`. Allowed values for `visibility` are `public`, `private`, and `any`. [#623](https://github.com/sourcebot-dev/sourcebot/pull/623)
20
+
- Changed `archived` query prefix to accept values `yes`, `no`, and `only`. [#623](https://github.com/sourcebot-dev/sourcebot/pull/623)
Copy file name to clipboardExpand all lines: docs/docs/features/search/syntax-reference.mdx
+31-12Lines changed: 31 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,32 +4,51 @@ title: Writing search queries
4
4
5
5
Sourcebot uses a powerful regex-based query language that enabled precise code search within large codebases.
6
6
7
-
8
7
## Syntax reference guide
9
8
10
-
Queries consist of space-separated regular expressions. Wrapping expressions in `""` combines them. By default, a file must have at least one match for each expression to be included.
9
+
Queries consist of space-separated search patterns that are matched against file contents. A file must have at least one match for each expression to be included. Queries can optionally contain search filters to further refine the search results.
10
+
11
+
## Keyword search (default)
12
+
13
+
Keyword search matches search patterns exactly in file contents. Wrapping search patterns in `""` combines them as a single expression.
11
14
12
15
| Example | Explanation |
13
16
| :--- | :--- |
14
-
|`foo`| Match files with regex `/foo/`|
15
-
|`foo bar`| Match files with regex `/foo/`**and**`/bar/`|
16
-
|`"foo bar"`| Match files with regex `/foo bar/`|
17
+
|`foo`| Match files containing the keyword `foo`|
18
+
|`foo bar`| Match files containing both `foo`**and**`bar`|
19
+
|`"foo bar"`| Match files containing the phrase `foo bar`|
Multiple expressions can be or'd together with `or`, negated with `-`, or grouped with `()`.
24
+
Toggle the regex button (`.*`) in the search bar to interpret search patterns as regular expressions.
19
25
20
26
| Example | Explanation |
21
27
| :--- | :--- |
22
-
|`foo or bar`| Match files with regex `/foo/`**or**`/bar/`|
23
-
|`foo -bar`| Match files with regex `/foo/` but **not**`/bar/`|
24
-
|`foo (bar or baz)`| Match files with regex `/foo/`**and** either `/bar/`**or**`/baz/`|
28
+
|`foo`| Match files with regex `/foo/`|
29
+
|`foo.*bar`| Match files with regex `/foo.*bar/` (foo followed by any characters, then bar) |
30
+
|`^function\s+\w+`| Match files with regex `/^function\s+\w+/` (function at start of line, followed by whitespace and word characters) |
31
+
|`"foo bar"`| Match files with regex `/foo bar/`. Quotes are not matched. |
25
32
26
-
Expressions can be prefixed with certain keywords to modify search behavior. Some keywords can be negated using the `-` prefix.
33
+
## Search filters
34
+
35
+
Search queries (keyword or regex) can include multiple search filters to further refine the search results. Some filters can be negated using the `-` prefix.
27
36
28
37
| Prefix | Description | Example |
29
38
| :--- | :--- | :--- |
30
39
|`file:`| Filter results from filepaths that match the regex. By default all files are searched. |`file:README` - Filter results to filepaths that match regex `/README/`<br/>`file:"my file"` - Filter results to filepaths that match regex `/my file/`<br/>`-file:test\.ts$` - Ignore results from filepaths match regex `/test\.ts$/`|
31
-
|`repo:`| Filter results from repos that match the regex. By default all repos are searched. |`repo:linux` - Filter results to repos that match regex `/linux/`<br/>`-repo:^web/.*` - Ignore results from repos that match regex `/^web\/.*`|
40
+
|`repo:`| Filter results from repos that match the regex. By default all repos are searched. |`repo:linux` - Filter results to repos that match regex `/linux/`<br/>`-repo:^web/.*` - Ignore results from repos that match regex `/^web\/.*/`|
32
41
|`rev:`| Filter results from a specific branch or tag. By default **only** the default branch is searched. |`rev:beta` - Filter results to branches that match regex `/beta/`|
33
42
|`lang:`| Filter results by language (as defined by [linguist](https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml)). By default all languages are searched. |`lang:TypeScript` - Filter results to TypeScript files<br/>`-lang:YAML` - Ignore results from YAML files |
34
43
|`sym:`| Match symbol definitions created by [universal ctags](https://ctags.io/) at index time. |`sym:\bmain\b` - Filter results to symbols that match regex `/\bmain\b/`|
35
-
|`context:`| Filter results to a predefined [search context](/docs/features/search/search-contexts). |`context:web` - Filter results to the web context<br/>`-context:pipelines` - Ignore results from the pipelines context |
44
+
|`context:`| Filter results to a predefined [search context](/docs/features/search/search-contexts). |`context:web` - Filter results to the web context<br/>`-context:pipelines` - Ignore results from the pipelines context |
45
+
46
+
## Boolean operators & grouping
47
+
48
+
By default, space-separated expressions are and'd together. Using the `or` keyword as well as parentheses `()` can be used to create more complex boolean logic. Parentheses can be negated using the `-` prefix.
49
+
50
+
| Example | Explanation |
51
+
| :--- | :--- |
52
+
|`foo or bar`| Match files containing `foo`**or**`bar`|
53
+
|`foo (bar or baz)`| Match files containing `foo`**and** either `bar`**or**`baz`. |
54
+
|`-(foo) bar`| Match files containing `bar`**and not**`foo`. |
0 commit comments