mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Backport PR #8349
--------- **Commit 1:** Always set output.params.min_doc_count instead of leaving Elasticsearch default (which changed). Ref: 5665 * Original sha:5eb43cf70b
* Authored by LeeDr <lee.drengenberg@elastic.co> on 2016-09-19T20:47:34Z **Commit 2:** Fix tests for min_doc_count change * Original sha:fe60886cdd
* Authored by LeeDr <lee.drengenberg@elastic.co> on 2016-09-19T23:07:46Z
This commit is contained in:
parent
63d7eb3c5e
commit
0441267add
2 changed files with 6 additions and 4 deletions
|
@ -67,15 +67,15 @@ describe('Histogram Agg', function () {
|
|||
expect(output.params).to.have.property('min_doc_count', 0);
|
||||
});
|
||||
|
||||
it('writes nothing for false values', function () {
|
||||
it('writes 1 for falsey values', function () {
|
||||
let output = paramWriter.write({ min_doc_count: '' });
|
||||
expect(output.params).to.not.have.property('min_doc_count');
|
||||
expect(output.params).to.have.property('min_doc_count', 1);
|
||||
|
||||
output = paramWriter.write({ min_doc_count: null });
|
||||
expect(output.params).to.not.have.property('min_doc_count');
|
||||
expect(output.params).to.have.property('min_doc_count', 1);
|
||||
|
||||
output = paramWriter.write({ min_doc_count: undefined });
|
||||
expect(output.params).to.not.have.property('min_doc_count');
|
||||
expect(output.params).to.have.property('min_doc_count', 1);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ export default function HistogramAggDefinition(Private) {
|
|||
write: function (aggConfig, output) {
|
||||
if (aggConfig.params.min_doc_count) {
|
||||
output.params.min_doc_count = 0;
|
||||
} else {
|
||||
output.params.min_doc_count = 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue