Hi guys:
There is a mistake here about elasticsearch1.7.5 :
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[EklIxB3jTH2gBt6-sjT6wA][i_dsrhx][0]: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]}{[yro95n9hSsaROrA1oPCOTQ][i_dsrhx][1]: RemoteTransportException[[node39][inet[/172.16.32.39:9300]][indices:data/read/search[phase/query]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]; }{[SPXGeONTROGMG2poPJkq8w][i_dsrhx][2]: RemoteTransportException[[node38][inet[/172.16.32.38:9300]][indices:data/read/search[phase/query]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]; }{[9jUAFgprR1GO2xXw0_fXRw][i_dsrhx][3]: RemoteTransportException[[node220][inet[/172.16.32.220:9300]][indices:data/read/search[phase/query]]]; nested: ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]; }]",
"status": 500
}
The mapping is {
"i_dsrhx": {
"mappings": {
"t_dsrzb": {
"_id": {
"path": "_ID"
},
"properties": {
"C_AJEJFL": {
"type": "string",
"index": "not_analyzed"
},
"C_AJYJFL": {
"type": "string",
"index": "not_analyzed"
},
"C_AY": {
"type": "string",
"index": "not_analyzed"
},
"C_AYDM": {
"type": "string",
"index": "not_analyzed"
},
"C_DSRBH": {
"type": "string",
"index": "not_analyzed"
},
"C_DSRMC": {
"type": "string",
"index": "not_analyzed"
},
"C_EJAJFL": {
"type": "string"
},
"C_YJAJFL": {
"type": "string"
},
"DT_ZHXGSJ": {
"type": "string"
},
"N_AJS": {
"type": "long"
},
"N_CFQSCS": {
"type": "long"
},
"N_DSRLX": {
"type": "long"
},
"N_FKCS": {
"type": "long"
},
"N_FXCS": {
"type": "long"
},
"N_GBZXCS": {
"type": "long"
},
"N_GZAJCD": {
"type": "long"
},
"N_KJZXCS": {
"type": "long"
},
"N_SDCS": {
"type": "long"
},
"N_SFJLCS": {
"type": "long"
},
"N_SFJZCS": {
"type": "long"
},
"N_SJDLGX": {
"type": "long"
},
"N_SSBL": {
"type": "double"
},
"N_SXCS": {
"type": "long"
},
"N_XSJLCS": {
"type": "long"
},
"N_YJAJS": {
"type": "long"
},
"N_ZSAJS": {
"type": "long"
},
"N_ZXDWL": {
"type": "double"
},
"_ID": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
i used javaAPI like this SumBuilder ajsSb = AggregationBuilders.sum("ajs").field("N_AJS");
any idears?