Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sorting ElasticSearch如何将聚合结果与多字段的另一个字段排序_Sorting_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch - Fatal编程技术网 elasticsearch,Sorting,elasticsearch" /> elasticsearch,Sorting,elasticsearch" />

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"
      }
    }
  }
}