Sorting ElasticSearch如何将聚合结果与多字段的另一个字段排序
我正在尝试对聚合结果进行排序。Sorting ElasticSearch如何将聚合结果与多字段的另一个字段排序,sorting,elasticsearch,Sorting,elasticsearch,我正在尝试对聚合结果进行排序。 我使用的是elasticsearch 1.7 我使用了一个多字段,其中一个已分析的字段是ascifold(themes),另一个未分析的字段是themes.raw 此查询正在运行,但按未分析字段排序 有办法吗 映射分析器: "settings": { "analysis": { "analyzer": { "analyzer_en": { "type": "custom",
我使用的是elasticsearch 1.7 我使用了一个多字段,其中一个已分析的字段是ascifold(themes),另一个未分析的字段是themes.raw 此查询正在运行,但按未分析字段排序 有办法吗 映射分析器:
"settings": {
"analysis": {
"analyzer": {
"analyzer_en": {
"type": "custom",
"tokenizer": "my_edge_ngram_tokenizer",
"filter": ["stop_custom_en", "stop_orig_en", "asciifolding", "lowercase", "snowball_en" ]
}
}
}
}
映射多个字段:
"properties": {
"themes": {
"type" : "multi_field",
"fields": {
"themes": {
"type": "string",
"analyzer": "analyzer_en"
},
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
聚合调用:
"aggregations": {
"themes": {
"terms" : {
"field": "themes.raw",
"size" : 100,
"order": {
"_term": "asc"
}
}
}
}