-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Update Kuery Syntax #15857
Update Kuery Syntax #15857
Changes from all commits
f3d557e
3f30cfa
04f6f1f
ae28f0a
46c5b3d
fe6c545
85fc579
162a497
2d86135
f7c9a54
9abab5d
53db30a
6ee08ca
668c87a
6086784
85e3213
0a71bcd
ae4fa1c
4d0e24e
8b6bb8e
1f904b9
1f5dc0b
52c37e2
add4315
5b0e255
3aa556e
83efe9f
5b49247
51dd1ca
0467194
f87bae7
f9f8866
c50a950
fdde95d
5c1cfc0
add467f
9392ce5
fe8bdec
5ff9588
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { groupBy, has } from 'lodash'; | ||
import { DecorateQueryProvider } from '../_decorate_query'; | ||
import { buildQueryFromKuery, buildQueryFromKql } from './from_kuery'; | ||
import { buildQueryFromKuery } from './from_kuery'; | ||
import { buildQueryFromFilters } from './from_filters'; | ||
import { buildQueryFromLucene } from './from_lucene'; | ||
|
||
|
@@ -17,16 +17,15 @@ export function BuildESQueryProvider(Private) { | |
const queriesByLanguage = groupBy(validQueries, 'language'); | ||
|
||
const kueryQuery = buildQueryFromKuery(indexPattern, queriesByLanguage.kuery); | ||
const kqlQuery = buildQueryFromKql(indexPattern, queriesByLanguage.kql); | ||
const luceneQuery = buildQueryFromLucene(queriesByLanguage.lucene, decorateQuery); | ||
const filterQuery = buildQueryFromFilters(filters, decorateQuery, indexPattern); | ||
|
||
return { | ||
bool: { | ||
must: [].concat(kueryQuery.must, kqlQuery.must, luceneQuery.must, filterQuery.must), | ||
filter: [].concat(kueryQuery.filter, kqlQuery.filter, luceneQuery.filter, filterQuery.filter), | ||
should: [].concat(kueryQuery.should, kqlQuery.should, luceneQuery.should, filterQuery.should), | ||
must_not: [].concat(kueryQuery.must_not, kqlQuery.must_not, luceneQuery.must_not, filterQuery.must_not), | ||
must: [].concat(kueryQuery.must, luceneQuery.must, filterQuery.must), | ||
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. If I'm following correctly, you got rid of the KQL version here because you pushed the logic for determining whether something is KQL or Kuery inside buildQueryFromKuery? Is that right? 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. Yep! |
||
filter: [].concat(kueryQuery.filter, luceneQuery.filter, filterQuery.filter), | ||
should: [].concat(kueryQuery.should, luceneQuery.should, filterQuery.should), | ||
must_not: [].concat(kueryQuery.must_not, luceneQuery.must_not, filterQuery.must_not), | ||
} | ||
}; | ||
} | ||
|
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.
Are we calling it Kuery or KQL? The PR description makes it sound like we are renaming it KQL, but here it's still referred to as Kuery.
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.
Yeah sorry, it's a bit confusing. We've been calling the simple language "KQL" in the code and amongst ourselves to distinguish it from the old complex grammar. It'll still be called "kuery" in the UI when this PR is merged, but the plan is ultimately to remove the language dropdown and just add a checkbox to opt-in to "query language enhancements", which will turn on the simple language hopefully without it seeming like a big jump to a whole different language. At that point we can get rid of the kuery name, it just didn't make sense to us to introduce yet another new language to the language switcher only to take it away soon after.