Closed EnglishVillage closed 6 years ago
hi @EnglishVillage could you add an example document, and clarify what the expected result should be compared to what you are getting? Thank you.
This is a side effect of https://github.com/elastic/elasticsearch/issues/28688.
Sub-aggregations with specific behavior in preProcess
and postProcess
don't work well with composite in 6.2. This issue has been fixed in a refactoring which will be available in 6.3 (the next minor release of 6.x):
https://github.com/elastic/elasticsearch/pull/28745
Thanks for reporting @EnglishVillage
ok thanks for the help @jimczi I am closing this then given that it's already fixed.
Thanks @javanna
Describe the feature: first composite agg,then cardinality agg. can't run in string type, cardinality result always = 0
Elasticsearch version (
bin/elasticsearch --version
): 6.2.2Plugins installed: [] analysis-pinyin(chinese) and sql
JVM version (
java -version
): 1.8.0_111OS version (
uname -a
if on a Unix-like system): test server: Linux testes1 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux server: Linux server1 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 23 17:05:11 UTC 2016 x86_64 x86_64 x86_64 GNU/LinuxDescription of the problem including expected versus actual behavior: if long type or date type, it can run. but string type,it cat't run...
Steps to reproduce:
Please include a minimal but complete recreation of the problem, including (e.g.) index creation, mappings, settings, query etc. The easier you make for us to reproduce it, the more likely that somebody will take the time to look at it.
1. mappings: { "import_bidding": { "dynamic_templates": [ { "stringfield": { "mapping": { "type" : "keyword", "doc_values": "false" }, "match_mapping_type": "string", "match": "*" } } ], "properties": { "province": { "type" : "keyword" }, "innCN": { "type" : "keyword" }, "companyNameN": { "type" : "keyword" }, "unitPrice": { "type" : "double" } } } } 2. settings: { "settings": { "index.mapping.coerce": true, "index.mapping.ignore_malformed": false, "index.number_of_shards": 3 } } 3. query: { "size": 0, "timeout": "5m", "aggregations": { "innCN": { "composite": { "size": 10, "sources": [{ "innCN": { "terms": { "field": "innCN", "order": "asc" } } }, { "companyNameN": { "terms": { "field": "companyNameN", "order": "asc" } } }] }, "aggregations": { "unitPrice": { "percentiles": { "field": "unitPrice", "percents": [50.0], "keyed": true, "tdigest": { "compression": 100.0 } } }, "province": { "cardinality": { "field": "province", "precision_threshold": 300 } } } } } } 4. result: province value should > 0 [{innCN=阿司匹林, companyNameN=万邦德制药集团股份有限公司, unitPrice=0.0195, province=0.0}, {innCN=阿司匹林, companyNameN=上海上药信谊药厂有限公司, unitPrice=0.03475, province=0.0}, {innCN=阿司匹林, companyNameN=上海信谊百路达药业有限公司, unitPrice=0.042, province=0.0}, {innCN=阿司匹林, companyNameN=上海华源制药股份有限公司, unitPrice=0.048, province=0.0}, {innCN=阿司匹林, companyNameN=临汾宝珠制药有限公司, unitPrice=0.0409, province=0.0}, {innCN=阿司匹林, companyNameN=丹东医创药业有限责任公司, unitPrice=0.0197, province=0.0}, {innCN=阿司匹林, companyNameN=云南白药集团股份有限公司, unitPrice=0.047, province=0.0}, {innCN=阿司匹林, companyNameN=亚宝药业集团股份有限公司, unitPrice=0.026, province=0.0}, {innCN=阿司匹林, companyNameN=亿帆医药股份有限公司, unitPrice=0.158, province=0.0}, {innCN=阿司匹林, companyNameN=内蒙古通辽制药股份有限公司, unitPrice=0.08, province=0.0}]
Provide logs (if relevant):