-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(search-syntax): Add new wildcard ops #15098
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
Open
nsdeschenes
wants to merge
5
commits into
master
Choose a base branch
from
nd/exp-502/feat-search-syntax-new-wildcard-ops
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+29
−4
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0a3968e
:art: Apply prettier
nsdeschenes 400e1cf
:speech_balloon: Change asterisk wildcard from opreator to character
nsdeschenes adc040a
:sparkles: Add in new section regarding wildcard operators
nsdeschenes 1378334
:speech_balloon: Update Wildcards to Wildcard Character
nsdeschenes bbd0496
:speech_balloon: Update to new spaceless wildcard operators
nsdeschenes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,10 @@ Search is available on several features throughout [sentry.io](https://sentry.io | |
## Query Syntax | ||
|
||
<Alert> | ||
You'll only need to use query syntax if you're using a Sentry [API](/api/). You'll get pre-populated suggestions once you start typing in your search terms when using the search bar anywhere in [Sentry.io](https://sentry.sentry.io/). | ||
You'll only need to use query syntax if you're using a Sentry [API](/api/). | ||
You'll get pre-populated suggestions once you start typing in your search | ||
terms when using the search bar anywhere in | ||
[Sentry.io](https://sentry.sentry.io/). | ||
</Alert> | ||
|
||
Search queries are constructed using a `key:value` pattern, with an optional raw search at the end. Each `key:value` pair is a `token` and the optional raw search is itself a single `token`. The `key:value` pair `tokens` are treated as issue or event properties. The optional raw search is treated as a single `token` and searches event titles/messages. | ||
|
@@ -112,24 +115,46 @@ is:unresolved !user.email:[email protected] | |
|
||
In the example above, the search query returns all Issues that are unresolved _and_ have not affected the user with the email address `[email protected]`. | ||
|
||
#### Wildcards | ||
#### Wildcard Character | ||
|
||
Search supports the wildcard operator `*` as a placeholder for specific characters and strings. | ||
Search supports the wildcard character `*` as a placeholder for specific characters and strings. | ||
|
||
``` | ||
browser:"Safari 11*" | ||
``` | ||
|
||
In the example above, the search query will match on `browser` values like `"Safari 11.0.2"`, `"Safari 11.0.3"`, etc. | ||
|
||
You may also combine operators like so: | ||
You may also combine the wildcard character `*` with other operators like so: | ||
|
||
``` | ||
!message:"*Timeout" | ||
``` | ||
|
||
In the above example, the search query returns results which do not have message values like `ConnectionTimeout`, `ReadTimeout`, etc. | ||
|
||
#### Wildcard Operators | ||
|
||
<Alert> | ||
When using these operators, the base wildcard character `*` will be treated as | ||
a literal character and not as a wildcard. | ||
</Alert> | ||
|
||
Sentry's API supports the use of the following wildcard operators when making requests to the API. | ||
|
||
For ease of use, we recommend using the wildcard `*` character instead of these operators when manually querying the API. | ||
|
||
``` | ||
# contains, and does not contain | ||
browser:Containschrome, !browser:Containsfire | ||
|
||
# starts with, and does not start with | ||
browser:StartsWithchrome, !browser:StartsWithchrome | ||
|
||
# ends with, and does not end with | ||
browser:EndsWithchrome, !browser:EndsWithfire | ||
``` | ||
|
||
## Page Filters | ||
|
||
Page filters allow you to narrow down the results shown on a page by selecting specific projects, environments, and date ranges. After you've set your filters, they'll persist as you navigate across pages in Sentry. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsdeschenes Are these supposed to show as rectangles like this?

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yessir, the squares are actually unicode characters that we use to delineate that these are wildcard operators, and not part of the users query.
In an ideal world, users will not be using these directly, rather interacting with the UI, which handles all of this for them, and they never see it.