This repository has been archived by the owner on Jan 7, 2018. It is now read-only.
Simpler query builder interface for constructing admin analytics queries #7
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.
In the current admin tool, if you wish to filter your analytics, you have to construct a query using Lucene's query syntax (which we pass along to ElasticSearch). This is powerful and flexible, but if you're not familiar with this syntax language or our internal field names, this isn't particularly friendly (especially when you get to URL paths and the need to escape slashes). Making an easier interface for people to filter the analytics has been on our todo list for forever.
This is an initial implementation of an easier query building interface. We're largely leveraging the jQuery QueryBuilder library to provide the UI for this. This provides drop down menus for picking which fields to filter on, the ability to choose conditions like "begins with", "contains", or "greater than", and then you can enter a search value (or choose from options for fields we know have a limited set of values). I've also added better inline help to describe each field. A screenshot probably best describes its functionality:
Hopefully this is a lot more intuitive for most people to use. The fields available for filtering in this UI isn't entirely complete (we store other fields internally), but I think this covers the main fields that 98% of queries are probably interested in. The old interface is also available if you click the "Switch to advanced filters" link, so if you're still keen on the raw ElasticSearch/Lucene queries, that functionality is still present and works just like before.