Skip to content

Commit

Permalink
Merge pull request #7542 from cjcenizal/bug/msearch-test-stored-fields
Browse files Browse the repository at this point in the history
Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API.
  • Loading branch information
cjcenizal authored Jul 5, 2016
2 parents 935f597 + d9cf54f commit 5588983
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/elasticsearch/lib/__tests__/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

});
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/kibana/public/doc/controllers/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/index_patterns/_get_computed_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default function () {
});

return {
fields: ['*', '_source'],
storedFields: ['*'],
_source: true,
scriptFields: scriptFields,
fielddataFields: fielddataFields
};
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/index_patterns/_get_ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5588983

Please sign in to comment.