Monday 15 March 2010

elasticsearch - How to use stats aggregation to compute stats over string field -



elasticsearch - How to use stats aggregation to compute stats over string field -

i have document this:

"_source": { "@fields": { "category": "card", "content": "code", "time": "2014-10-22t20:17:58", "score": "278579" }

my stats aggregation statement is:

"aggs": { "score_stats": { "stats": {"field": "score"} } }

and elasticsearch throw exception

classcastexception[org.elasticsearch.index.fielddata.plain.pagedbytesindexfielddata cannot cast org.elasticsearch.index.fielddata.indexnumericfielddata

my question how can utilize stats aggregation statistical result score field string type

i solved problem, using mapping config forcefulness score field long type.

{

"score": {"type": "long"}

}

elasticsearch

No comments:

Post a Comment