From d9cf54f119d57448e4042ac9205c4ef40ad68992 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Thu, 23 Jun 2016 20:39:01 -0700 Subject: [PATCH] Rename 'fields' property to 'stored_fields' to adhere to new ES msearch API. - Upgrade elasticsearch client to 12.0.0-rc4. --- package.json | 4 ++-- src/plugins/elasticsearch/lib/__tests__/routes.js | 2 +- src/plugins/kibana/public/doc/controllers/doc.js | 3 ++- .../public/index_patterns/__tests__/_get_computed_fields.js | 4 ++-- src/ui/public/index_patterns/_get_computed_fields.js | 3 ++- src/ui/public/index_patterns/_get_ids.js | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index c7b47c2991167..67db39f1216e4 100644 --- a/package.json +++ b/package.json @@ -101,8 +101,8 @@ "csv-parse": "1.1.0", "d3": "3.5.6", "dragula": "3.7.0", - "elasticsearch": "10.1.2", - "elasticsearch-browser": "10.1.2", + "elasticsearch": "12.0.0-rc4", + "elasticsearch-browser": "12.0.0-rc4", "even-better": "7.0.2", "expiry-js": "0.1.7", "exports-loader": "0.6.2", diff --git a/src/plugins/elasticsearch/lib/__tests__/routes.js b/src/plugins/elasticsearch/lib/__tests__/routes.js index 34a75f6a29814..d0378413adf14 100644 --- a/src/plugins/elasticsearch/lib/__tests__/routes.js +++ b/src/plugins/elasticsearch/lib/__tests__/routes.js @@ -105,7 +105,7 @@ describe('plugins/elasticsearch', function () { testRoute({ method: 'POST', url: '/elasticsearch/_msearch?timeout=0&ignore_unavailable=true&preference=1429577952339', - payload: '{"index":"logstash-2015.04.21","ignore_unavailable":true}\n{"size":500,"sort":{"@timestamp":"desc"},"query":{"bool":{"must":[{"query_string":{"analyze_wildcard":true,"query":"*"}},{"bool":{"must":[{"range":{"@timestamp":{"gte":1429577068175,"lte":1429577968175}}}],"must_not":[]}}],"must_not":[]}},"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}}},"aggs":{"2":{"date_histogram":{"field":"@timestamp","interval":"30s","min_doc_count":0,"extended_bounds":{"min":1429577068175,"max":1429577968175}}}},"fields":["*","_source"],"script_fields":{},"fielddata_fields":["timestamp_offset","@timestamp","utc_time"]}\n' // eslint-disable-line max-len + payload: '{"index":"logstash-2015.04.21","ignore_unavailable":true}\n{"size":500,"sort":{"@timestamp":"desc"},"query":{"bool":{"must":[{"query_string":{"analyze_wildcard":true,"query":"*"}},{"bool":{"must":[{"range":{"@timestamp":{"gte":1429577068175,"lte":1429577968175}}}],"must_not":[]}}],"must_not":[]}},"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}}},"aggs":{"2":{"date_histogram":{"field":"@timestamp","interval":"30s","min_doc_count":0,"extended_bounds":{"min":1429577068175,"max":1429577968175}}}},"stored_fields":["*"],"_source": true,"script_fields":{},"fielddata_fields":["timestamp_offset","@timestamp","utc_time"]}\n' // eslint-disable-line max-len }); }); diff --git a/src/plugins/kibana/public/doc/controllers/doc.js b/src/plugins/kibana/public/doc/controllers/doc.js index d42ca2ca876e7..97be464e705d1 100644 --- a/src/plugins/kibana/public/doc/controllers/doc.js +++ b/src/plugins/kibana/public/doc/controllers/doc.js @@ -50,7 +50,8 @@ app.controller('doc', function ($scope, $route, es, timefilter) { values: [$route.current.params.id] } }, - fields: computedFields.fields, + stored_fields: computedFields.storedFields, + _source: computedFields._source, script_fields: computedFields.scriptFields, fielddata_fields: computedFields.fielddataFields } diff --git a/src/ui/public/index_patterns/__tests__/_get_computed_fields.js b/src/ui/public/index_patterns/__tests__/_get_computed_fields.js index bd03519dea951..d63cb0358a32d 100644 --- a/src/ui/public/index_patterns/__tests__/_get_computed_fields.js +++ b/src/ui/public/index_patterns/__tests__/_get_computed_fields.js @@ -23,11 +23,11 @@ describe('get computed fields', function () { }); it('should request all stored fields', function () { - expect(fn().fields).to.contain('*'); + expect(fn().storedFields).to.contain('*'); }); it('should request _source seperately', function () { - expect(fn().fields).to.contain('_source'); + expect(fn()._source).to.be(true); }); it('should request date fields as fielddata_fields', function () { diff --git a/src/ui/public/index_patterns/_get_computed_fields.js b/src/ui/public/index_patterns/_get_computed_fields.js index f56f9af492a2d..0058661e4ba28 100644 --- a/src/ui/public/index_patterns/_get_computed_fields.js +++ b/src/ui/public/index_patterns/_get_computed_fields.js @@ -18,7 +18,8 @@ export default function () { }); return { - fields: ['*', '_source'], + storedFields: ['*'], + _source: true, scriptFields: scriptFields, fielddataFields: fielddataFields }; diff --git a/src/ui/public/index_patterns/_get_ids.js b/src/ui/public/index_patterns/_get_ids.js index 3f8ce6a716e16..b499b1dd3859d 100644 --- a/src/ui/public/index_patterns/_get_ids.js +++ b/src/ui/public/index_patterns/_get_ids.js @@ -16,7 +16,7 @@ export default function GetIndexPatternIdsFn(es, kbnIndex) { cachedPromise = es.search({ index: kbnIndex, type: 'index-pattern', - fields: [], + storedFields: [], body: { query: { match_all: {} }, size: 10000