# Encount a java.lang.ClassCastException: org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData

**URL:** <https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431>\
**Category:** Elasticsearch\
**Created:** [June 15, 2013, 10:05am UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431 "2013-06-15T10:05:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![11121](https://avatars.discourse-cdn.com/v4/letter/1/b38774/32.png) [@11121](https://discuss.elastic.co/u/11121)\
**Post date:** [June 15, 2013, 10:05am UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/1 "2013-06-15T10:05:34Z")

</div>

This is business log stat app in development.  
I used version of elasticsearch is 0.90.1

$curl -XGET '[http://192.168.11.107:9200/](http://192.168.11.107:9200/)'

> {  
> "ok" : true,  
> "status" : 200,  
> "name" : "Ape",  
> "version" : {  
> "number" : "0.90.1",  
> "snapshot\_build" : false,  
> "lucene\_version" : "4.3"  
> },  
> "tagline" : "You Know, for Search"  
> }

And Mapping is simple except time filed is a dateOptionalTime

> $ curl -XGET '[http://192.168.11.107:9200/syslog/syslog/\_mapping?pretty](http://192.168.11.107:9200/syslog/syslog/_mapping?pretty)'  
> {  
> "syslog" : {  
> "properties" : {  
> "facility" : {  
> "type" : "string"  
> },  
> "hostname" : {  
> "type" : "string"  
> },  
> "id" : {  
> "type" : "string"  
> },  
> "message" : {  
> "type" : "string"  
> },  
> "serverity" : {  
> "type" : "long"  
> },  
> "tag" : {  
> "type" : "string"  
> },  
> "time" : {  
> "type" : "date",  
> "format" : "dateOptionalTime"  
> },  
> "type" : {  
> "type" : "string"  
> }  
> }  
> }  
> }

There is some example data,I use ISO dateformat:

> $ curl -XGET [http://192.168.11.107:9200/syslog/syslog/\_search?pretty=](http://192.168.11.107:9200/syslog/syslog/_search?pretty=) -d '  
> {  
> "from": 0,  
> "size": 2,  
> "query": {  
> "match\_all": {  
> }  
> }  
> }'  
> {  
> "took" : 0,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 100020,  
> "max\_score" : 1.0,  
> "hits" : [ {  
> "\_index" : "syslog",  
> "\_type" : "syslog",  
> "\_id" : "6242157e-755c-4996-8219-c9b9458a5a26",  
> "\_score" : 1.0, "\_source" :  
> {"id":"6242157e-755c-4996-8219-c9b9458a5a26","facility":"test","serverity":6,"time":"2013-06-15T00:00:00","hostname":"127.0.0.1","tag":"test","message":"hello  
> there,1371225600548","type":"com.broadwave.service.log.Log"}  
> }, {  
> "\_index" : "syslog",  
> "\_type" : "syslog",  
> "\_id" : "bf1739f5-93eb-40b8-958d-f27315f9bb7e",  
> "\_score" : 1.0, "\_source" :  
> {"id":"bf1739f5-93eb-40b8-958d-f27315f9bb7e","facility":"test","serverity":6,"time":"2013-06-15T00:00:00","hostname":"127.0.0.1","tag":"test","message":"hello  
> there,1371225600551","type":"com.broadwave.service.log.Log"}  
> } ]  
> }  
> }

And I meet problem when I use "Web front-end over elasticsearch data" list  
in Elasticsearch client page. I encounter exception on time field.

curl -XGET [http://192.168.11.107:9200/syslog/syslog/\_search?pretty=](http://192.168.11.107:9200/syslog/syslog/_search?pretty=) -d '  
{  
"facets": {  
"time": {  
"date\_histogram": {  
"field": "time",  
"interval": "hour"  
}  
}  
}  
}'  
[2013-06-15 17:42:41,781][DEBUG][action.search.type] [Ape]  
[syslog][1], node[yn3er67mTN2lIGO7r8uXjw], [P], s[STARTED]: Failed to  
execute [org.elasticsearch.action.search.SearchRequest@3cc95a]  
org.elasticsearch.search.SearchParseException: [syslog][1]:  
query[ConstantScore(_:_)],from[0],size[100]: Parse Failure [Failed to parse  
source [  
{  
"from": 0,  
"size": 100,  
"query": {  
"match\_all": {

```
}

```

},  
"facets": {  
"time": {  
"date\_histogram": {  
"field": "time",  
"interval": "hour"  
}  
}  
}  
}]]  
at  
org.elasticsearch.search.SearchService.parseSource(SearchService.java:573)  
at  
org.elasticsearch.search.SearchService.createContext(SearchService.java:484)  
at  
org.elasticsearch.search.SearchService.createContext(SearchService.java:469)  
at  
org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:462)  
at  
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:206)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:193)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:179)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)  
Caused by: java.lang.ClassCastException:  
org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be  
cast to org.elasticsearch.index.fielddata.IndexNumericFieldData  
at  
org.elasticsearch.search.facet.datehistogram.DateHistogramFacetParser.parse(DateHistogramFacetParser.java:162)  
at  
org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)  
at  
org.elasticsearch.search.SearchService.parseSource(SearchService.java:561)  
... 12 more

Am I do something wrong?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Fatima\_Castiglione\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fatima_castiglione_m/32/2252_2.png) [@Fatima\_Castiglione\_M](https://discuss.elastic.co/u/Fatima_Castiglione_M)\
**Post date:** [June 15, 2013, 10:18am UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/2 "2013-06-15T10:18:23Z")

</div>

Hi Lei Xiao Bao

I am new to Elasticsearch (less than 1 month) but already have seen it  
being quite picky about some things (maybe it lacks some extra code in the  
parsing stages)...  
For example, I got a problem yesterday using an index name with CamelCase.

Maybe Elasticsearch does not like your date format, with that big "T" in  
between...  
"time":"2013-06-15T00:00:00"

The system error that you show, in my humble opinion, prints in a different  
format :  
[2013-06-15 17:42:41,781][DEBUG][action.search.type] [Ape]  
[syslog][1],

Just my 5 cents.

2013/6/15 雷晓宝 [lxbzmy@gmail.com](mailto:lxbzmy@gmail.com)

> This is business log stat app in development.  
> I used version of elasticsearch is 0.90.1
> 
> $curl -XGET '[http://192.168.11.107:9200/](http://192.168.11.107:9200/)'
> 
> > {  
> > "ok" : true,  
> > "status" : 200,  
> > "name" : "Ape",  
> > "version" : {  
> > "number" : "0.90.1",  
> > "snapshot\_build" : false,  
> > "lucene\_version" : "4.3"  
> > },  
> > "tagline" : "You Know, for Search"  
> > }
> 
> And Mapping is simple except time filed is a dateOptionalTime
> 
> > $ curl -XGET '[http://192.168.11.107:9200/syslog/syslog/\_mapping?pretty](http://192.168.11.107:9200/syslog/syslog/_mapping?pretty)'  
> > {  
> > "syslog" : {  
> > "properties" : {  
> > "facility" : {  
> > "type" : "string"  
> > },  
> > "hostname" : {  
> > "type" : "string"  
> > },  
> > "id" : {  
> > "type" : "string"  
> > },  
> > "message" : {  
> > "type" : "string"  
> > },  
> > "serverity" : {  
> > "type" : "long"  
> > },  
> > "tag" : {  
> > "type" : "string"  
> > },  
> > "time" : {  
> > "type" : "date",  
> > "format" : "dateOptionalTime"  
> > },  
> > "type" : {  
> > "type" : "string"  
> > }  
> > }  
> > }  
> > }
> 
> There is some example data,I use ISO dateformat:
> 
> > $ curl -XGET [http://192.168.11.107:9200/syslog/syslog/\_search?pretty=](http://192.168.11.107:9200/syslog/syslog/_search?pretty=) -d  
> > '  
> > {  
> > "from": 0,  
> > "size": 2,  
> > "query": {  
> > "match\_all": {  
> > }  
> > }  
> > }'  
> > {  
> > "took" : 0,  
> > "timed\_out" : false,  
> > "\_shards" : {  
> > "total" : 5,  
> > "successful" : 5,  
> > "failed" : 0  
> > },  
> > "hits" : {  
> > "total" : 100020,  
> > "max\_score" : 1.0,  
> > "hits" : [ {  
> > "\_index" : "syslog",  
> > "\_type" : "syslog",  
> > "\_id" : "6242157e-755c-4996-8219-c9b9458a5a26",  
> > "\_score" : 1.0, "\_source" :  
> > {"id":"6242157e-755c-4996-8219-c9b9458a5a26","facility":"test","serverity":6,"time":"2013-06-15T00:00:00","hostname":"127.0.0.1","tag":"test","message":"hello  
> > there,1371225600548","type":"com.broadwave.service.log.Log"}  
> > }, {  
> > "\_index" : "syslog",  
> > "\_type" : "syslog",  
> > "\_id" : "bf1739f5-93eb-40b8-958d-f27315f9bb7e",  
> > "\_score" : 1.0, "\_source" :  
> > {"id":"bf1739f5-93eb-40b8-958d-f27315f9bb7e","facility":"test","serverity":6,"time":"2013-06-15T00:00:00","hostname":"127.0.0.1","tag":"test","message":"hello  
> > there,1371225600551","type":"com.broadwave.service.log.Log"}  
> > } ]  
> > }  
> > }
> 
> And I meet problem when I use "Web front-end over elasticsearch data"  
> list in Elasticsearch client page. I encounter exception on time field.
> 
> curl -XGET [http://192.168.11.107:9200/syslog/syslog/\_search?pretty=](http://192.168.11.107:9200/syslog/syslog/_search?pretty=) -d '  
> {  
> "facets": {  
> "time": {  
> "date\_histogram": {  
> "field": "time",  
> "interval": "hour"  
> }  
> }  
> }  
> }'  
> [2013-06-15 17:42:41,781][DEBUG][action.search.type] [Ape]  
> [syslog][1], node[yn3er67mTN2lIGO7r8uXjw], [P], s[STARTED]: Failed to  
> execute [org.elasticsearch.action.search.SearchRequest@3cc95a]  
> org.elasticsearch.search.SearchParseException: [syslog][1]:  
> query[ConstantScore(_:_)],from[0],size[100]: Parse Failure [Failed to parse  
> source [  
> {  
> "from": 0,  
> "size": 100,  
> "query": {  
> "match\_all": {
> 
> ```
> }
> 
> ```
> 
> },  
> "facets": {  
> "time": {  
> "date\_histogram": {  
> "field": "time",  
> "interval": "hour"  
> }  
> }  
> }  
> }]]  
> at  
> org.elasticsearch.search.SearchService.parseSource(SearchService.java:573)  
> at  
> org.elasticsearch.search.SearchService.createContext(SearchService.java:484)  
> at  
> org.elasticsearch.search.SearchService.createContext(SearchService.java:469)  
> at  
> org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:462)  
> at  
> org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:206)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:193)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:179)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:662)  
> Caused by: java.lang.ClassCastException:  
> org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be  
> cast to org.elasticsearch.index.fielddata.IndexNumericFieldData  
> at  
> org.elasticsearch.search.facet.datehistogram.DateHistogramFacetParser.parse(DateHistogramFacetParser.java:162)  
> at  
> org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)  
> at  
> org.elasticsearch.search.SearchService.parseSource(SearchService.java:561)  
> ... 12 more
> 
> Am I do something wrong?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

# --

Fátima Castiglione Maldonado  
[castiglionemaldonado@gmail.com](mailto:castiglionemaldonado@gmail.com)

```
                 ____
               ,'_ |

```

**_|||  
\< ) .------.  
 `-----------,------.-' ,-' `-.  
| | | ,' `. ,' | | ,' `.  
| ,-' |_ /   
 _,'-' `. `---._|**\_\_\_\_\_\_\_\_\_   
.--' -----. | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ `-. ----- | | ___| | | \ ,- \ | |___ | |===========================((|) | | | | | | _____________________ / `- / |  
`--._ -----' | _________________ ,-' ----- | `.-.\_ ,' \_\_.---' | /  
| `-. | \ / `. | | `. ,' | | | `. ,'  
\_\_\_\_\_,----------`-------`-. `-._ _,-' < ___________________________ ) `------'  
| _| |  
`._\_\_\_|

=================================

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 15, 2013, 10:32am UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/3 "2013-06-15T10:32:10Z")

</div>

This ClassCastException has been reported before at  
[https://groups.google.com/d/msg/elasticsearch/K7Z\_17U3im0/PJ6SBM\_ZX1cJ](https://groups.google.com/d/msg/elasticsearch/K7Z_17U3im0/PJ6SBM_ZX1cJ)

Jörg

Am 15.06.13 12:05, schrieb 雷晓宝:

> This is business log stat app in development.  
> I used version of elasticsearch is 0.90.1
> 
> ```
> $curl -XGET 'http://192.168.11.107:9200/'
> {
> "ok" : true,
> "status" : 200,
> "name" : "Ape",
> "version" : {
> "number" : "0.90.1",
> "snapshot_build" : false,
> "lucene_version" : "4.3"
> },
> "tagline" : "You Know, for Search"
> }
> 
> ```
> 
> And Mapping is simple except time filed is a dateOptionalTime
> 
> ```
> $ curl -XGET
> 'http://192.168.11.107:9200/syslog/syslog/_mapping?pretty'
> {
> "syslog" : {
> "properties" : {
> "facility" : {
> "type" : "string"
> },
> "hostname" : {
> "type" : "string"
> },
> "id" : {
> "type" : "string"
> },
> "message" : {
> "type" : "string"
> },
> "serverity" : {
> "type" : "long"
> },
> "tag" : {
> "type" : "string"
> },
> "time" : {
> "type" : "date",
> "format" : "dateOptionalTime"
> },
> "type" : {
> "type" : "string"
> }
> }
> }
> }
> 
> ```
> 
> There is some example data,I use ISO dateformat:
> 
> ```
> $ curl -XGET
> http://192.168.11.107:9200/syslog/syslog/_search?pretty= -d '
> {
> "from": 0,
> "size": 2,
> "query": {
> "match_all": {
> }
> }
> }'
> {
> "took" : 0,
> "timed_out" : false,
> "_shards" : {
> "total" : 5,
> "successful" : 5,
> "failed" : 0
> },
> "hits" : {
> "total" : 100020,
> "max_score" : 1.0,
> "hits" : [ {
> "_index" : "syslog",
> "_type" : "syslog",
> "_id" : "6242157e-755c-4996-8219-c9b9458a5a26",
> "_score" : 1.0, "_source" :
> {"id":"6242157e-755c-4996-8219-c9b9458a5a26","facility":"test","serverity":6,"time":"2013-06-15T00:00:00","hostname":"127.0.0.1","tag":"test","message":"hello
> there,1371225600548","type":"com.broadwave.service.log.Log"}
> }, {
> "_index" : "syslog",
> "_type" : "syslog",
> "_id" : "bf1739f5-93eb-40b8-958d-f27315f9bb7e",
> "_score" : 1.0, "_source" :
> {"id":"bf1739f5-93eb-40b8-958d-f27315f9bb7e","facility":"test","serverity":6,"time":"2013-06-15T00:00:00","hostname":"127.0.0.1","tag":"test","message":"hello
> there,1371225600551","type":"com.broadwave.service.log.Log"}
> } ]
> }
> }
> 
> ```
> 
> And I meet problem when I use "Web front-end over elasticsearch data"  
> list in Elasticsearch client page. I encounter exception on time field.
> 
> ```
> curl -XGET
> http://192.168.11.107:9200/syslog/syslog/_search?pretty= -d '
> {
> "facets": {
> "time": {
> "date_histogram": {
> "field": "time",
> "interval": "hour"
> }
> }
> }
> }'
> [2013-06-15 17:42:41,781][DEBUG][action.search.type] [Ape]
> [syslog][1], node[yn3er67mTN2lIGO7r8uXjw], [P], s[STARTED]: Failed
> to execute [org.elasticsearch.action.search.SearchRequest@3cc95a]
> org.elasticsearch.search.SearchParseException: [syslog][1]:
> query[ConstantScore(*:*)],from[0],size[100]: Parse Failure [Failed
> to parse source [
> {
> "from": 0,
> "size": 100,
> "query": {
> "match_all": {
> 
> }
> },
> "facets": {
> "time": {
> "date_histogram": {
> "field": "time",
> "interval": "hour"
> }
> }
> }
> }]]
> at
> org.elasticsearch.search.SearchService.parseSource(SearchService.java:573)
> at
> org.elasticsearch.search.SearchService.createContext(SearchService.java:484)
> at
> org.elasticsearch.search.SearchService.createContext(SearchService.java:469)
> at
> org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:462)
> at
> org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
> at
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)
> at
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
> at
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:206)
> at
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:193)
> at
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:179)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.ClassCastException:
> org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData
> cannot be cast to
> org.elasticsearch.index.fielddata.IndexNumericFieldData
> at
> org.elasticsearch.search.facet.datehistogram.DateHistogramFacetParser.parse(DateHistogramFacetParser.java:162)
> at
> org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)
> at
> org.elasticsearch.search.SearchService.parseSource(SearchService.java:561)
> ... 12 more
> 
> ```
> 
> ## Am I do something wrong?
> 
> You received this message because you are subscribed to the Google  
> Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send  
> an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11121](https://avatars.discourse-cdn.com/v4/letter/1/b38774/32.png) [@11121](https://discuss.elastic.co/u/11121)\
**Post date:** [June 15, 2013, 2:29pm UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/4 "2013-06-15T14:29:39Z")

</div>

Hi,  
"2009-11-15T14:12:12", This dateformat is right as u can find at offical  
documents [http://www.elasticsearch.org/guide/reference/mapping/core-types/](http://www.elasticsearch.org/guide/reference/mapping/core-types/)

{  
"tweet" {  
"user" : "kimchy"  
"message" : "This is a tweet!",  
"postDate" : "2009-11-15T14:12:12",  
"priority" : 4,  
"rank" : 12.3  
}  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11121](https://avatars.discourse-cdn.com/v4/letter/1/b38774/32.png) [@11121](https://discuss.elastic.co/u/11121)\
**Post date:** [June 15, 2013, 2:30pm UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/5 "2013-06-15T14:30:50Z")

</div>

I found that thread ,but I can get more useful tip to reslove my problem.

2013/6/15 Jörg Prante [joergprante@gmail.com](mailto:joergprante@gmail.com)

> This ClassCastException has been reported before at  
> [https://groups.google.com/d/\*\*msg/elasticsearch/K7Z\_17U3im0/\*\*PJ6SBM\_ZX1cJ](https://groups.google.com/d/ **msg/elasticsearch/K7Z_17U3im0/** PJ6SBM_ZX1cJ)[https://groups.google.com/d/msg/elasticsearch/K7Z\_17U3im0/PJ6SBM\_ZX1cJ](https://groups.google.com/d/msg/elasticsearch/K7Z_17U3im0/PJ6SBM_ZX1cJ)
> 
> Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Fatima\_Castiglione\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fatima_castiglione_m/32/2252_2.png) [@Fatima\_Castiglione\_M](https://discuss.elastic.co/u/Fatima_Castiglione_M)\
**Post date:** [June 15, 2013, 8:11pm UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/6 "2013-06-15T20:11:50Z")

</div>

Yes... It looks that way. You are right it.  
Even so... In the same documentation page that you mentioned I found  
this... (see pasted text below).

Look at the example, he includes a specific string to format the date.  
Maybe doing that may help.

(I really do not know, as I said, I am new to Elasticsearch, but... Your  
problem is interesting so I am just trying to help).

date

The date type is a special type which maps to JSON string type. It follows  
a specific format that can be explicitly set. All dates are UTC.  
Internally, a date maps to a number type long, with the added parsing stage  
from string to long and from long to string. An example mapping:

{  
"tweet" : {  
"properties" : {  
"postDate" : {  
"type" : "date",  
"format" : "YYYY-MM-dd"  
}  
}  
}  
}

The date type will also accept a long number representing UTC milliseconds  
since the epoch, regardless of the format it can handle.

2013/6/15 小雷 [lxbzmy@gmail.com](mailto:lxbzmy@gmail.com)

> Hi,  
> "2009-11-15T14:12:12", This dateformat is right as u can find at offical  
> documents [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types/)
> 
> {  
> "tweet" {
> 
> ```
> "user" : "kimchy"
> 
> "message" : "This is a tweet!",
> 
> "postDate" : "2009-11-15T14:12:12",
> 
> "priority" : 4,
> 
> "rank" : 12.3
> 
> }
> 
> ```
> 
> }
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

# --

Fátima Castiglione Maldonado  
[castiglionemaldonado@gmail.com](mailto:castiglionemaldonado@gmail.com)

```
                 ____
               ,'_ |

```

**_|||  
\< ) .------.  
 `-----------,------.-' ,-' `-.  
| | | ,' `. ,' | | ,' `.  
| ,-' |_ /   
 _,'-' `. `---._|**\_\_\_\_\_\_\_\_\_   
.--' -----. | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ `-. ----- | | ___| | | \ ,- \ | |___ | |===========================((|) | | | | | | _____________________ / `- / |  
`--._ -----' | _________________ ,-' ----- | `.-.\_ ,' \_\_.---' | /  
| `-. | \ / `. | | `. ,' | | | `. ,'  
\_\_\_\_\_,----------`-------`-. `-._ _,-' < ___________________________ ) `------'  
| _| |  
`._\_\_\_|

=================================

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11121](https://avatars.discourse-cdn.com/v4/letter/1/b38774/32.png) [@11121](https://discuss.elastic.co/u/11121)\
**Post date:** [June 16, 2013, 6:40am UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/7 "2013-06-16T06:40:59Z")

</div>

As I tried ,a bad date format data insert will throw a FormatException  
cause data reject by server.

In my test i inserted 100,000 rows successful .

Maybe I can test a fewer data first.

2013/6/16 Fatima Castiglione Maldonado 发 [castiglionemaldonado@gmail.com](mailto:castiglionemaldonado@gmail.com)

> Yes... It looks that way. You are right it.  
> Even so... In the same documentation page that you mentioned I found  
> this... (see pasted text below).
> 
> Look at the example, he includes a specific string to format the date.  
> Maybe doing that may help.
> 
> (I really do not know, as I said, I am new to Elasticsearch, but... Your  
> problem is interesting so I am just trying to help).
> 
> date
> 
> The date type is a special type which maps to JSON string type. It  
> follows a specific format that can be explicitly set. All dates are UTC.  
> Internally, a date maps to a number type long, with the added parsing  
> stage from string to long and from long to string. An example mapping:
> 
> {  
> "tweet" : {
> 
> ```
> "properties" : {
> 
> "postDate" : {
> 
> "type" : "date",
> 
> "format" : "YYYY-MM-dd"
> 
> }
> }
> 
> }
> 
> ```
> 
> }
> 
> The date type will also accept a long number representing UTC milliseconds  
> since the epoch, regardless of the format it can handle.
> 
> 2013/6/15 小雷 [lxbzmy@gmail.com](mailto:lxbzmy@gmail.com)
> 
> > Hi,  
> > "2009-11-15T14:12:12", This dateformat is right as u can find at offical  
> > documents  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types/)
> > 
> > {  
> > "tweet" {
> > 
> > ```
> > "user" : "kimchy"
> > 
> > "message" : "This is a tweet!",
> > 
> > "postDate" : "2009-11-15T14:12:12",
> > 
> > "priority" : 4,
> > 
> > "rank" : 12.3
> > 
> > }
> > 
> > ```
> > 
> > }
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> # --
> 
> Fátima Castiglione Maldonado  
> [castiglionemaldonado@gmail.com](mailto:castiglionemaldonado@gmail.com)
> 
> ```
> ____
> ,'_ |
> 
> ```
> 
> \_\_\_\_\_\_\__**|||  
> \<**_ ) _.------._  
> `-----------,------.-' ,-' `-.
> 
> ```
> | | | ,' `.
> ,' | | ,' `.
> | _,-' |__ / \
> _,'-' `. `---. ___|_____________ \
> 
> .--' -----. | _____________________ `-. ----- |
> | ___| | | \ ,- \ |
> | ___| |===========================((|) | |
> | | | | _____________________ / `- / |
> 
> `--._ -----' | _________________ ,-' ----- |
> `.-._ ,' __.---' | /
> | `-. | \ /
> `. | | `. ,'
> 
> | | | `. ,'
> 
> ```
> 
> \_\_\_\_\_,----------`-------`-. `-._ _,-' < ___________________________ ) `------'  
> | \_| |
> 
> ```
> `. ____ |
> 
> ```
> 
> =================================
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/YvuQbVo73bU/unsubscribe](https://groups.google.com/d/topic/elasticsearch/YvuQbVo73bU/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11121](https://avatars.discourse-cdn.com/v4/letter/1/b38774/32.png) [@11121](https://discuss.elastic.co/u/11121)\
**Post date:** [June 17, 2013, 6:16am UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/8 "2013-06-17T06:16:06Z")

</div>

Well, after some more tests. I think I found where the problem is.

I write it down for anyone reference:

current now ,The problem happens when u changed field type. es can not  
changed field type at runtime. If u found some field type error at test  
time.u must -XDELTE all and -XPUT \_mapping and -XPUT data again.

Then that cast exception happens. after query data 2nd time. I thinik ES  
cached filed type and not flush cache when mapping changed.

Restart ES may solve this problem.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Fatima\_Castiglione\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fatima_castiglione_m/32/2252_2.png) [@Fatima\_Castiglione\_M](https://discuss.elastic.co/u/Fatima_Castiglione_M)\
**Post date:** [June 17, 2013, 6:26am UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/9 "2013-06-17T06:26:29Z")

</div>

Thanks for posting the solution.

2013/6/17 雷晓宝 [lxbzmy@gmail.com](mailto:lxbzmy@gmail.com)

> Well, after some more tests. I think I found where the problem is.
> 
> I write it down for anyone reference:
> 
> current now ,The problem happens when u changed field type. es can not  
> changed field type at runtime. If u found some field type error at test  
> time.u must -XDELTE all and -XPUT \_mapping and -XPUT data again.
> 
> Then that cast exception happens. after query data 2nd time. I thinik ES  
> cached filed type and not flush cache when mapping changed.
> 
> Restart ES may solve this problem.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

# --

Fátima Castiglione Maldonado  
[castiglionemaldonado@gmail.com](mailto:castiglionemaldonado@gmail.com)

```
                 ____
               ,'_ |

```

**_|||  
\< ) .------.  
 `-----------,------.-' ,-' `-.  
| | | ,' `. ,' | | ,' `.  
| ,-' |_ /   
 _,'-' `. `---._|**\_\_\_\_\_\_\_\_\_   
.--' -----. | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ `-. ----- | | ___| | | \ ,- \ | |___ | |===========================((|) | | | | | | _____________________ / `- / |  
`--._ -----' | _________________ ,-' ----- | `.-.\_ ,' \_\_.---' | /  
| `-. | \ / `. | | `. ,' | | | `. ,'  
\_\_\_\_\_,----------`-------`-. `-._ _,-' < ___________________________ ) `------'  
| _| |  
`._\_\_\_|

=================================

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:30am UTC](https://discuss.elastic.co/t/encount-a-java-lang-classcastexception-org-elasticsearch-index-fielddata-plain-pagedbytesindexfielddata-cannot-be-cast-to-org-elasticsearch-index-fielddata-indexnumericfielddata/12431/10 "2017-07-06T02:30:54Z")

</div>


