ElasticSearch直方图方面异常

时间:2014-03-11 12:58:30

标签: java javascript json elasticsearch facets

当我在events索引上执行此查询时:

{
"query": { 
    "query_string": {
        "query": "*"
    } 
},
"facets": {
    "histo1": {
        "histogram": { 
            "key_field": "authorid",
            "value_field": "article",
            "interval": 10
        }
    }
}
}

我收到错误:

"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[_2jzw4DMR9mSnl5vLIK_4A][events][0]: SearchParseException[[events][0]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{\r\n\t\"query\": { \r\n\t\t\"query_string\": {\r\n\t\t\t\"query\": \"*\"\r\n\t\t} \r\n\t},\r\n\t\"facets\": {\r\n\t\t\"histo1\": {\r\n\t\t\t\"histogram\": { \r\n\t\t\t\t\"key_field\": \"authorid\",\r\n\t\t\t\t\"value_field\": \"article\",\r\n\t\t\t\t\"interval\": 10\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]; }{[_2jzw4DMR9mSnl5vLIK_4A][events][2]: SearchParseException[[events][2]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{\r\n\t\"query\": { \r\n\t\t\"query_string\": {\r\n\t\t\t\"query\": \"*\"\r\n\t\t} \r\n\t},\r\n\t\"facets\": {\r\n\t\t\"histo1\": {\r\n\t\t\t\"histogram\": { \r\n\t\t\t\t\"key_field\": \"authorid\",\r\n\t\t\t\t\"value_field\": \"article\",\r\n\t\t\t\t\"interval\": 10\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}]]]; nested: { goes on and on this way... }

key_fieldvalue_field都存在。

当我遗漏查询的facets部分时,它将成功查询。

有什么想法吗?

0 个答案:

没有答案