我不知道我做错了什么。我对整数字段“状态”有一个术语聚合,但NumberFormatException
通过运行查询得到。我有 2 个状态字段,一个在 _source.status 中,类型为整数,一个是 _source.report.status,类型为long
错误信息
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed;
shardFailures {[qIeOaS8SS4ynp938pIXZyg][outboxprov1][3]:
ElasticsearchException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: UncheckedExecutionException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }{[qIeOaS8SS4ynp938pIXZyg][outboxprov1][4]:
ElasticsearchException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: UncheckedExecutionException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }{[qIeOaS8SS4ynp938pIXZyg][outboxprov1][0]:
ElasticsearchException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: UncheckedExecutionException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }{[qIeOaS8SS4ynp938pIXZyg][outboxprov1][1]:
ElasticsearchException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: UncheckedExecutionException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }{[qIeOaS8SS4ynp938pIXZyg][outboxprov1][2]:
ElasticsearchException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: UncheckedExecutionException[java.lang.NumberFormatException:
Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }]",
"status": 500
}
询问
{
"size": 0,
"query": {
"match_all": {}
},
"aggs": {
"total": {
"terms": {
"field": "status", // type : "integer"
"order": {
"_term": "asc"
}
}
},
"immediate_total": {
"terms": {
"field": "immediate",
"order": {
"_term": "asc"
}
}
},
"daily_post_count": {
"filter": {
"range": {
"created_date": {
"from": "2014-11-27",
"to": "2014-11-27"
}
}
},
"aggs": {
"today_posts": {
"terms": {
"field": "status", // type : "integer"
"order": {
"_term": "asc"
}
}
},
"today_immediate": {
"terms": {
"field": "immediate",
"order": {
"_term": "asc"
}
}
}
}
}
}
}
映射
{
"test": {
"mappings": {
"message": {
"properties": {
"approved_date": {
"type": "date",
"format": "dateOptionalTime"
},
"approver": {
"type": "string"
},
"content": {
"type": "string",
"store": true
},
"contents": {
"properties": {
"'facebook'": {
"type": "string"
},
"approver": {
"type": "string"
},
"contents": {
"type": "string"
},
"created_date": {
"type": "date",
"format": "dateOptionalTime"
},
"facebok": {
"type": "string"
},
"facebook": {
"type": "string"
},
"failed": {
"type": "long"
},
"hash": {
"type": "string"
},
"immediate": {
"type": "long"
},
"link": {
"type": "string"
},
"linkedin": {
"type": "string"
},
"message_date": {
"type": "date",
"format": "dateOptionalTime"
},
"network_connectors": {
"type": "string"
},
"post_count": {
"type": "long"
},
"preview": {
"type": "string"
},
"preview_description": {
"type": "string"
},
"preview_image_url": {
"type": "string"
},
"preview_title": {
"type": "string"
},
"sent": {
"type": "long"
},
"status": {
"type": "long"
},
"twitter": {
"type": "string"
}
}
},
"created_date": {
"type": "date",
"format": "dateOptionalTime"
},
"created_ip": {
"type": "ip"
},
"created_user": {
"type": "string",
"index": "not_analyzed"
},
"failed": {
"type": "long"
},
"folder": {
"type": "integer"
},
"hash": {
"type": "string"
},
"immediate": {
"type": "long"
},
"link": {
"type": "string"
},
"message_date": {
"type": "date",
"format": "dateOptionalTime"
},
"modified_date": {
"type": "date",
"format": "dateOptionalTime"
},
"network_connectors": {
"type": "string",
"index": "not_analyzed"
},
"post_count": {
"type": "long"
},
"preview": {
"type": "string"
},
"preview_description": {
"type": "string"
},
"preview_image_url": {
"type": "string"
},
"preview_title": {
"type": "string"
},
"report": {
"properties": {
"info": {
"type": "string"
},
"networks": {
"type": "string"
},
"status": {
"type": "long"
}
}
},
"sent": {
"type": "long"
},
"status": {
"type": "integer"
},
"team_id": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
请帮我解决这个问题。谢谢你。