Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions fixtures/search-syntax/contains_operator.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[
{
"query": "browser.name:containsfirefox",
"query": "browser.name:Containsfirefox",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "text",
"negated": false,
"operator": "contains",
"operator": "Contains",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {"type": "valueText", "value": "firefox", "quoted": false}
},
{"type": "spaces", "value": ""}
]
},
{
"query": "browser.name:contains[firefox, chrome]",
"query": "browser.name:Contains[firefox, chrome]",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "textIn",
"negated": false,
"operator": "contains",
"operator": "Contains",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {
"type": "valueTextList",
Expand All @@ -42,29 +42,29 @@
]
},
{
"query": "!browser.name:containsfirefox",
"query": "!browser.name:Containsfirefox",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "text",
"negated": true,
"operator": "contains",
"operator": "Contains",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {"type": "valueText", "value": "firefox", "quoted": false}
},
{"type": "spaces", "value": ""}
]
},
{
"query": "!browser.name:contains[firefox, chrome]",
"query": "!browser.name:Contains[firefox, chrome]",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "textIn",
"negated": true,
"operator": "contains",
"operator": "Contains",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {
"type": "valueTextList",
Expand Down
16 changes: 8 additions & 8 deletions fixtures/search-syntax/ends_with_operator.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[
{
"query": "browser.name:ends withfirefox",
"query": "browser.name:EndsWithfirefox",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "text",
"negated": false,
"operator": "ends with",
"operator": "EndsWith",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {"type": "valueText", "value": "firefox", "quoted": false}
},
{"type": "spaces", "value": ""}
]
},
{
"query": "browser.name:ends with[firefox, chrome]",
"query": "browser.name:EndsWith[firefox, chrome]",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "textIn",
"negated": false,
"operator": "ends with",
"operator": "EndsWith",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {
"type": "valueTextList",
Expand All @@ -42,29 +42,29 @@
]
},
{
"query": "!browser.name:ends withfirefox",
"query": "!browser.name:EndsWithfirefox",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "text",
"negated": true,
"operator": "ends with",
"operator": "EndsWith",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {"type": "valueText", "value": "firefox", "quoted": false}
},
{"type": "spaces", "value": ""}
]
},
{
"query": "!browser.name:ends with[firefox, chrome]",
"query": "!browser.name:EndsWith[firefox, chrome]",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "textIn",
"negated": true,
"operator": "ends with",
"operator": "EndsWith",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {
"type": "valueTextList",
Expand Down
16 changes: 8 additions & 8 deletions fixtures/search-syntax/starts_with_operator.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[
{
"query": "browser.name:starts withfirefox",
"query": "browser.name:StartsWithfirefox",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "text",
"negated": false,
"operator": "starts with",
"operator": "StartsWith",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {"type": "valueText", "value": "firefox", "quoted": false}
},
{"type": "spaces", "value": ""}
]
},
{
"query": "browser.name:starts with[firefox, chrome]",
"query": "browser.name:StartsWith[firefox, chrome]",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "textIn",
"negated": false,
"operator": "starts with",
"operator": "StartsWith",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {
"type": "valueTextList",
Expand All @@ -42,29 +42,29 @@
]
},
{
"query": "!browser.name:starts withfirefox",
"query": "!browser.name:StartsWithfirefox",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "text",
"negated": true,
"operator": "starts with",
"operator": "StartsWith",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {"type": "valueText", "value": "firefox", "quoted": false}
},
{"type": "spaces", "value": ""}
]
},
{
"query": "!browser.name:starts with[firefox, chrome]",
"query": "!browser.name:StartsWith[firefox, chrome]",
"result": [
{"type": "spaces", "value": ""},
{
"type": "filter",
"filter": "textIn",
"negated": true,
"operator": "starts with",
"operator": "StartsWith",
"key": {"type": "keySimple", "value": "browser.name", "quoted": false},
"value": {
"type": "valueTextList",
Expand Down
6 changes: 3 additions & 3 deletions src/sentry/api/event_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@
negation = "!"
# Note: wildcard unicode is defined in src/sentry/search/events/constants.py
wildcard_unicode = "\uF00D"
contains = "contains"
starts_with = "starts with"
ends_with = "ends with"
contains = "Contains"
starts_with = "StartsWith"
ends_with = "EndsWith"
comma = ","
spaces = " "*

Expand Down
6 changes: 3 additions & 3 deletions src/sentry/search/events/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ class ThresholdDict(TypedDict):
WILDCARD_UNICODE = "\uf00d"

WILDCARD_OPERATOR_MAP = {
"contains": f"{WILDCARD_UNICODE}contains{WILDCARD_UNICODE}",
"starts_with": f"{WILDCARD_UNICODE}starts with{WILDCARD_UNICODE}",
"ends_with": f"{WILDCARD_UNICODE}ends with{WILDCARD_UNICODE}",
"contains": f"{WILDCARD_UNICODE}Contains{WILDCARD_UNICODE}",
"starts_with": f"{WILDCARD_UNICODE}StartsWith{WILDCARD_UNICODE}",
"ends_with": f"{WILDCARD_UNICODE}EndsWith{WILDCARD_UNICODE}",
}

MAX_SEARCH_RELEASES = 1000
Expand Down
6 changes: 3 additions & 3 deletions static/app/components/searchSyntax/grammar.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ closed_bracket = "]"
sep = ":"
negation = "!"
wildcard_unicode = [\uF00D]
contains = "contains"
starts_with = "starts with"
ends_with = "ends with"
contains = "Contains"
starts_with = "StartsWith"
ends_with = "EndsWith"
comma = ","
spaces = " "* { return tc.tokenSpaces(text()) }

Expand Down
18 changes: 9 additions & 9 deletions static/app/components/searchSyntax/parser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ export enum TermOperator {
LESS_THAN = '<',
EQUAL = '=',
NOT_EQUAL = '!=',
CONTAINS = '\uf00dcontains\uf00d',
DOES_NOT_CONTAIN = '\uf00ddoes not contain\uf00d',
STARTS_WITH = '\uf00dstarts with\uf00d',
DOES_NOT_START_WITH = '\uf00ddoes not start with\uf00d',
ENDS_WITH = '\uf00dends with\uf00d',
DOES_NOT_END_WITH = '\uf00ddoes not end with\uf00d',
CONTAINS = '\uf00dContains\uf00d',
DOES_NOT_CONTAIN = '\uf00dDoesNotContain\uf00d',
STARTS_WITH = '\uf00dStartsWith\uf00d',
DOES_NOT_START_WITH = '\uf00dDoesNotStartWith\uf00d',
ENDS_WITH = '\uf00dEndsWith\uf00d',
DOES_NOT_END_WITH = '\uf00dDoesNotEndWith\uf00d',
}

/**
Expand Down Expand Up @@ -125,9 +125,9 @@ export enum FilterType {
* Unicode Character: `\uf00d`
*/
export enum WildcardOperators {
CONTAINS = '\uf00dcontains\uf00d',
STARTS_WITH = '\uf00dstarts with\uf00d',
ENDS_WITH = '\uf00dends with\uf00d',
CONTAINS = '\uf00dContains\uf00d',
STARTS_WITH = '\uf00dStartsWith\uf00d',
ENDS_WITH = '\uf00dEndsWith\uf00d',
}

export const basicOperators = [TermOperator.DEFAULT, TermOperator.NOT_EQUAL] as const;
Expand Down
Loading
Loading