当我在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_field
和value_field
都存在。
当我遗漏查询的facets
部分时,它将成功查询。
有什么想法吗?