-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Move buildEsQuery to a package #23345
Changes from 6 commits
e27ba53
1308202
0480b9c
72fbe52
7c93a4b
391060f
fb63b64
dafa660
a96841a
09a69ed
844037d
96f133f
a2fb932
8f2480c
63d230d
3884518
cb0aea2
0a0a6d6
09e4331
b783ea9
36b4259
f124678
d8bfa36
414c311
a13a749
4fbac25
887c97a
103ee2b
d1d0970
59f978f
e36d7ab
f0149b1
99a8bc0
245f72c
991d46f
04f5e37
9fd38fe
7db5961
df364f0
408ddb4
ffa8657
ee4ddc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,9 @@ import { searchRequestQueue } from '../search_request_queue'; | |
import { FetchSoonProvider } from '../fetch'; | ||
import { FieldWildcardProvider } from '../../field_wildcard'; | ||
import { getHighlightRequest } from '../../../../core_plugins/kibana/common/highlight'; | ||
import { BuildESQueryProvider } from './build_query'; | ||
import { BuildESQueryProvider } from '../../../../utils/es_query'; | ||
import { KbnError } from '../../errors'; | ||
import { documentationLinks } from '../../documentation_links'; | ||
|
||
const FIELDS = [ | ||
'type', | ||
|
@@ -601,7 +603,16 @@ export function SearchSourceProvider(Promise, Private, config) { | |
_.set(flatData.body, '_source.includes', remainingFields); | ||
} | ||
|
||
flatData.body.query = buildESQuery(flatData.index, flatData.query, flatData.filters); | ||
try { | ||
flatData.body.query = buildESQuery(flatData.index, flatData.query, flatData.filters); | ||
} catch (e) { | ||
if (e.message === 'OutdatedKuerySyntaxError') { | ||
const message = `It looks like you're using an outdated Kuery syntax. | ||
See what changed in the [docs](${documentationLinks.query.kueryQuerySyntax})!`; | ||
throw new KbnError(message, KbnError); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than adding the message / link back here, would it be better to add a class for this error type to |
||
} | ||
throw new KbnError(e.message, KbnError); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok now that I see this, I'm assuming that's why you removed the wildcard error type? |
||
} | ||
|
||
if (flatData.highlightAll != null) { | ||
if (flatData.highlightAll && flatData.body.query) { | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"id": "logstash-*", | ||
"title": "logstash-*", | ||
"fields": [ | ||
{ | ||
|
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.
Out of interest: why are we ignoring those two files for linting? :)
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.
They're generated by PEG