0

I have an index and I wanna know the medium number of the field "comments". Here's my (basic) query:

GET /prova/_search?search_type=count
{
    "aggs" : {
        "avg_grade" : { "avg" : { "field" : "commenti" } }
    }
}

But something goes wrong and the reply is:

{
   "error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[T4svhJ5TTmOfY2-E4_t9YQ][prova][0]: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]}{[T4svhJ5TTmOfY2-E4_t9YQ][prova][1]: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]}{[T4svhJ5TTmOfY2-E4_t9YQ][prova][2]: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]}{[T4svhJ5TTmOfY2-E4_t9YQ][prova][3]: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]}{[T4svhJ5TTmOfY2-E4_t9YQ][prova][4]: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]}]",
   "status": 500
}

What's the problem?

5
  • Is the field commenti in more that one type? Is it always a numeric type? Commented Feb 20, 2015 at 17:23
  • possible duplicate of elasticsearch fail with error "Failed to execute phase [query_fetch], all shards failed" Commented Feb 20, 2015 at 17:28
  • Also read: devmynd.com/blog/… Commented Feb 20, 2015 at 17:29
  • Usually is a number, otherwise is an empty space Commented Feb 24, 2015 at 12:02
  • It is not a duplicate, it doesn't seem to me the same problem or however the solution isn't good for my problem, Commented Feb 24, 2015 at 12:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.