Skip to content
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

Merged
merged 11 commits into from
Aug 2, 2017

Conversation

Bargs
Copy link
Contributor

@Bargs Bargs commented Jul 24, 2017

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.

Copy link
Member

@lukasolson lukasolson left a 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
Copy link
Member

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.

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

Copy link
Contributor Author

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?


[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.
Copy link
Member

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.


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.
Copy link
Member

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?

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.
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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?

include::kuery.asciidoc[]

[[save-load-search]]
=== Saving and Loading Searches
Copy link
Member

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.

@Bargs
Copy link
Contributor Author

Bargs commented Jul 31, 2017

@lukasolson I've addressed all your suggestions

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Bargs
Copy link
Contributor Author

Bargs commented Aug 1, 2017

@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 🙃

@alexfrancoeur
Copy link

@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!

Copy link

@alexfrancoeur alexfrancoeur left a 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

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

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.

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

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"

Copy link
Contributor Author

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)`

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)

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.

Copy link
Contributor Author

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.

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

[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.
============

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"

Copy link
Contributor Author

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.

geoBoundingBox::
Purpose::: Creates a geo_bounding_box query
Examples:::
* `geoBoundingBox("coordinates", topLeft="40.73, -74.1", bottomRight="40.01, -71.12")`

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)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, added a note

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.

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,"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -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.

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"

Copy link
Contributor Author

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.

@Bargs
Copy link
Contributor Author

Bargs commented Aug 1, 2017

@alexfrancoeur I made another round of updates, let me know what you think.

@Bargs Bargs merged commit f78bb5d into elastic:master Aug 2, 2017
Bargs added a commit to Bargs/kibana that referenced this pull request Aug 2, 2017
* Add Kuery docs and break search page into subsections
Bargs added a commit to Bargs/kibana that referenced this pull request Aug 2, 2017
* Add Kuery docs and break search page into subsections
Bargs added a commit that referenced this pull request Aug 2, 2017
* Add Kuery docs and break search page into subsections
Bargs added a commit that referenced this pull request Aug 2, 2017
* Add Kuery docs and break search page into subsections
@alexfrancoeur
Copy link

LGTM @Bargs (even though it's already merged 😄 ). Love that we've used kueries in the docs

@Bargs
Copy link
Contributor Author

Bargs commented Aug 2, 2017

@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 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants