-
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
Add Kuery docs and break search page into subsections #13074
Conversation
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.
Added a few minor comments below.
experimental[This functionality is experimental and may be changed or removed completely in a future release.] | ||
|
||
Kuery is a new query language built specifically for Kibana. It aims to simplify the search experience in Kibana | ||
and enable the creation of helpful features like auto-complete, seamless migration of saved searches, additional |
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.
It might be nice to add additional clarification that these helpful features (like autocomplete) aren't available now, but will be in the future.
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.
++ explicitly stating that these features are not available today help advertise the benefits of the new language.
"It aims to simplify the search experience in Kibana and enable the creation of helpful features that aren't available today. Kuery will pave the way for features like auto-complete, seamless migration of saved searches, additional..." or something along those lines
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.
@alexfrancoeur I already added a clarification per Lukas's suggestion, were you looking at the most recent changes?
docs/discover/kuery.asciidoc
Outdated
|
||
[NOTE] | ||
============ | ||
Terms without fields will be matched against all fields. For example, a query for 200 will search for the value 200 across all fields in your index. |
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.
Since queries above are inside ticks (to format them as code) I think it'd be nice if it was 200
instead of just 200.
docs/discover/kuery.asciidoc
Outdated
|
||
Kuery queries are built with functions. Many functions take a field name as their first argument. Extremely common functions have shorthand notations. | ||
|
||
`is("response", 200)` will match documents where the response field matches the value 200. |
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.
Do you want to add something about how quotes are optional for values that don't have whitespace?
docs/discover/search.asciidoc
Outdated
your search criteria in the Query bar. You can use the Lucene | ||
https://lucene.apache.org/core/2_9_4/queryparsersyntax.html[ | ||
query syntax], the full JSON-based {ref}/query-dsl.html[Elasticsearch | ||
Query DSL], or an experimental new query language built specifically for Kibana. |
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.
Might be nice to mention Kuery by name here, since you do down below and in the Kuery docs themselves.
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, I tried to fit it in but this is just a really long sentence already. Suggestions to make it flow better?
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.
You could just say "or Kuery, an experimental...". Or, it might honestly be better to break it up into three separate bullet points. Thoughts?
docs/discover/search.asciidoc
Outdated
include::kuery.asciidoc[] | ||
|
||
[[save-load-search]] | ||
=== Saving and Loading Searches |
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.
Since it's called "opening" down below, might make sense to use the same terminology here.
@lukasolson I've addressed all your suggestions |
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.
LGTM
@alexfrancoeur do you think you'll have time to take a peek at these doc changes? I'd love to get feedback from someone who hasn't looked at the code so I know if what I've written will actually make sense to users 🙃 |
@Bargs there is a rogue tab with this documentation open about a week ago somewhere in this mess of tabs and browsers. Reviewing now - apologies for the delay! |
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.
Overall this looks good. I had some minor feedback but reading through the docs makes sense. The only thing I found missing here is a comparison to ES/Lucene queries. This may be more for a blog post but the only place I would have expected to see the comparison (if any) is in the function reference section.
experimental[This functionality is experimental and may be changed or removed completely in a future release.] | ||
|
||
Kuery is a new query language built specifically for Kibana. It aims to simplify the search experience in Kibana | ||
and enable the creation of helpful features like auto-complete, seamless migration of saved searches, additional |
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.
++ explicitly stating that these features are not available today help advertise the benefits of the new language.
"It aims to simplify the search experience in Kibana and enable the creation of helpful features that aren't available today. Kuery will pave the way for features like auto-complete, seamless migration of saved searches, additional..." or something along those lines
docs/discover/kuery.asciidoc
Outdated
query types, and more. Kuery is a basic experience today but we're hard at work building these additional features on | ||
top of the foundation Kuery provides. | ||
|
||
Kuery queries are built with functions. Many functions take a field name as their first argument. Extremely common functions have shorthand notations. |
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.
"Kuery" is being thrown around a lot here. Maybe we can replace some of these with other ways to describe kuery, "Our new query language" for example
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.
Instead of "Kuery queries are built with functions" I think it'd fine just saying "Queries are built with functions" If we wanted to have some fun here we could also say "Kueries are built with functions"
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.
I was seeing how far I could get before someone told me to calm down with all the kuery queries 😄
Switched it to just be "Kueries"
|
||
Entire groups can also be inverted. | ||
|
||
`response:200 and !(extension:php or extension:css)` |
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.
wasn't there an invert option that uses not
that is the equivalent of !
- response:200 and not(extensions:php or extension:css)
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.
Looks like this in mentioned in the function reference - can't hurt to show here as well.
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.
I don't think the not()
syntax will get much usage. I worry about making this section too verbose, if we mention not()
it seems like we should also mention and()
and or()
|
||
Quotes are generally optional if your terms don't have whitespace or special characters. `range(bytes, gt=1000, lt=8000)` | ||
would also be a valid query. | ||
|
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.
good job showing with and without quotes
docs/discover/kuery.asciidoc
Outdated
[NOTE] | ||
============ | ||
Terms without fields will be matched against all fields. For example, a query for `200` will search for the value 200 across all fields in your index. | ||
============ |
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.
Can we add a bit more detail here? I'm guessing that this is referring to a plain text search in the input box? Maybe we can say "Searching for terms without defining a field will default to matching that value against all 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.
I added a counter example that hopefully helps clarify things, let me know what you think.
docs/discover/kuery.asciidoc
Outdated
geoBoundingBox:: | ||
Purpose::: Creates a geo_bounding_box query | ||
Examples::: | ||
* `geoBoundingBox("coordinates", topLeft="40.73, -74.1", bottomRight="40.01, -71.12")` |
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.
do we ignore whitespace in between lat/long here (and below)?
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.
Yep, added a note
docs/discover/search.asciidoc
Outdated
your search criteria in the Query bar. You can use the Lucene | ||
https://lucene.apache.org/core/2_9_4/queryparsersyntax.html[ | ||
query syntax], the full JSON-based {ref}/query-dsl.html[Elasticsearch | ||
Query DSL], or Kuery, an experimental new query language built specifically for Kibana. |
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.
"DSL], or Kuery," I think we might have one too many comma's ==> "DSL] or 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.
👍
docs/discover/search.asciidoc
Outdated
@@ -66,7 +79,6 @@ To load a saved search into Discover: | |||
If the saved search is associated with a different index pattern than is currently | |||
selected, opening the saved search also changes the selected index pattern. |
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.
How does Kuery behave here? If there are saved searches that were saved with Lucene syntax - does Discover still use Lucene? It might be worth adding a note here "if you're using Kuery, blah blah"
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.
Great point, it'll automatically select the language that the saved search was written in. Added a note.
@alexfrancoeur I made another round of updates, let me know what you think. |
* Add Kuery docs and break search page into subsections
* Add Kuery docs and break search page into subsections
LGTM @Bargs (even though it's already merged 😄 ). Love that we've used kueries in the docs |
@alexfrancoeur sorry for the early merge, just wanted to get these in so I could put up another PR that links to these docs from Kibana 😅 |
I added some documentation for the new Kuery language and attempted to break the "Searching Your Data" page into subsections that hopefully make it a bit more organized. My intent is for each subsection (prefixed with
===
) to have its own page and link in the table of contents on the right hand side though I couldn't totally confirm this was working since local doc builds seem to work slightly differently than they do for the website.