Commit 4e1d8c9c by Naoufel JAMALI Committed by Torkel Ödegaard

Elasticsearch - Term aggregation limit fix (should fix #7112) (#7338)

* Elasticsearch - Term aggregation limit fix  (should fix #7112)

* Elasticsearch - Term aggregation limit fix
parent b6305a65
...@@ -29,7 +29,6 @@ function (queryDef) { ...@@ -29,7 +29,6 @@ function (queryDef) {
} }
queryNode.terms.size = parseInt(aggDef.settings.size, 10) === 0 ? 500 : parseInt(aggDef.settings.size, 10); queryNode.terms.size = parseInt(aggDef.settings.size, 10) === 0 ? 500 : parseInt(aggDef.settings.size, 10);
if (aggDef.settings.orderBy !== void 0) { if (aggDef.settings.orderBy !== void 0) {
queryNode.terms.order = {}; queryNode.terms.order = {};
queryNode.terms.order[aggDef.settings.orderBy] = aggDef.settings.order; queryNode.terms.order[aggDef.settings.orderBy] = aggDef.settings.order;
...@@ -243,19 +242,21 @@ function (queryDef) { ...@@ -243,19 +242,21 @@ function (queryDef) {
} }
}); });
} }
var size = 500;
if(queryDef.size){
size = queryDef.size;
}
query.aggs = { query.aggs = {
"1": { "1": {
"terms": { "terms": {
"field": queryDef.field, "field": queryDef.field,
"size": 500, "size": size,
"order": { "order": {
"_term": "asc" "_term": "asc"
} }
}, },
} }
}; };
return query; return query;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment