With elasticsearch starting to validate query string parameters, we need to stop sending the extra "_" query string paramters (used to cache-bust in browsers). The changes are larger than "necessary" because the url parsing and formatting logic was updated to use the bonafide `url.parse` and `url.format` methods, rather than a series of specialized string mutations. The tests for this code were also expanded as a part of this effort.
These are the biggest offenders of dom node leaks during the browser
tests runs (there are more - specifically with leakage of
$rootScope.$new not being subsequently destroyed, but that takes up
significantly less memory).
This fix lets me run browser tests with consistent results.
When the error coming from the elasticsearch.js client is not as expected, isTermSizeZeroError throws a TypeError. This seems incorrect, the function should just return true or false in just about any scenario.
We don't have any mechanism in place right now to verify that the third
party backends that ship with Timelion are continuing to work as
expected, and in the event that any service introduces a backwards
compatibility break or becomes unavailable, we have no plan for how
users can workaround the issue.
This is essentially the same situation we found ourselves in with our
third party tile map provider, so we should at least come up with
solutions for this before removing the experimental labels.
Using the field_capabilities API added in the previous commit, this commit enhances
the client side index pattern object with information about the
searchable and aggregatable status of each field in the index pattern.
We then use this information to filter out non-aggregatable fields from
the vis editor so that users won't accidentally select them and get
nasty errors. An example of a non-aggregatable field would be a `text`
field without fielddata enabled (which is the default).
I also added the searchable and aggregatable flags to the index pattern
page so users can see the status of their fields. I removed the `indexed`
column because it was mostly redundant with `searchable` and I needed
the horizontal space.
The addition of the searchable and aggregatable properties for index
pattern fields would require users to manually refresh their field list
when upgrading to 5.0. This commit also adds a check for those properties and
if they're missing it automatically refreshes the field list for the
user in a seamless manner.
This adds a simple API for getting the searchable/aggregatable status of
a list of fields in a given index, list of indices, or index pattern. In
the future this will probably evolve into a full blown fields info API
that we can use when removing the index pattern mapping cache. For now
though it's built to provide the minimum info needed to fix
https://github.com/elastic/kibana/issues/6769
Usage:
The API exposes a single GET endpoint.
```
GET /api/kibana/{indices}/field_capabilities
```
`indices` can be a single index, a comma delimited list, or a wildcard
pattern
Example response:
```
{
"fields": {
"imsearchable": {
"searchable": true,
"aggregatable": false
},
"imaggregatable": {
"searchable": true,
"aggregatable": true
},
}
}
```