[SearchBar] Added support for emitting a Query as an Elasticsearch query string#598
Merged
uboness merged 1 commit intoelastic:masterfrom Mar 30, 2018
uboness:enhance/query_to_es_string
Merged
[SearchBar] Added support for emitting a Query as an Elasticsearch query string#598uboness merged 1 commit intoelastic:masterfrom uboness:enhance/query_to_es_string
uboness merged 1 commit intoelastic:masterfrom
uboness:enhance/query_to_es_string
Conversation
chrisronline
approved these changes
Mar 30, 2018
Contributor
chrisronline
left a comment
There was a problem hiding this comment.
One minor question, but otherwise, LGTM!
I'm not sure if it will be necessary, but it's cool to see the possibility of AST -> KQL in the future!
| } | ||
| }; | ||
|
|
||
| const emitFieldDateValueCalue = (field, value, operator, match) => { |
Contributor
There was a problem hiding this comment.
What is Calue here? Typo for Clause?
Contributor
Author
|
thx!
well... as far as I know, the saved objects api still requires you to provide an ES query string, doesn't it? |
Contributor
|
Yea that's right, so this should be super helpful for that use case! |
…ery string Example: ``` const query = Query.parse(`john group:(eng or "marketing org") -date:'2004-03' -is:active`); console.log(Query.toEsQueryString(query)); ``` the above logs: ``` +john +(group:eng OR group:"marketing org") -date:(>=2004-03 AND <2004-04) +active:false ```
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Example:
the above logs: