# PagedBytesIndexFieldData cannot be cast to IndexNumericFieldData

**URL:** <https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227>\
**Category:** Elasticsearch\
**Created:** [January 13, 2014, 10:34pm UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227 "2014-01-13T22:34:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![VB1](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@VB1](https://discuss.elastic.co/u/VB1)\
**Post date:** [January 13, 2014, 10:34pm UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/1 "2014-01-13T22:34:38Z")

</div>

Hello all,

I have a weird problem. When i try to run facet using following query I get  
error that  
PagedBytesIndexFieldData cannot be cast to  
org.elasticsearch.index.fielddata.IndexNumericFieldData]

But my field is of long data type and I am not figure out why i am getting  
error

This is the query

{  
"query": {  
"match\_all": {}  
},  
"facets": {  
"Id": {  
"statistical": {  
"field": "Id"  
}  
}  
}  
}

And these are my mappings

{  
"contractsearch": {  
"dynamic": "strict",  
"properties": {  
"TransactionIdList": {  
"properties": {  
"TransactionId": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "TransactionId"  
}  
},  
"type": "nested"  
},  
"Id": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "Id"  
},  
"ExposureId": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "ExposureId"  
},  
"CreateUserId": {  
"type": "integer",  
"index": "not\_analyzed",  
"index\_Name": "CreateUserId"  
},  
"ExternalSourceName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ExternalSourceName",  
"null\_Value": "unasSigned"  
},  
"Name": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "Name"  
},  
"Description": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "Description"  
},  
"ExposureNumber": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ExposureNumber"  
},  
"ProgramName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ProgramName"  
},  
"ExposedPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ExposedPartyName",  
"null\_Value": "unasSigned"  
},  
"ContractTypeName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ContractTypeName",  
"null\_Value": "unasSigned"  
},  
"UserDefContractTypeName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "UserDefContractTypeName",  
"null\_Value": "unasSigned"  
},  
"LineofBusinessName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "LineofBusinessName",  
"null\_Value": "unasSigned"  
},  
"ContractStatusName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ContractStatusName",  
"null\_Value": "unasSigned"  
},  
"InsuredPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "InsuredPartyName",  
"null\_Value": "unasSigned"  
},  
"InsurerPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "InsurerPartyName",  
"null\_Value": "unasSigned"  
},  
"BrokerPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "BrokerPartyName",  
"null\_Value": "unasSigned"  
},  
"UnderwriterPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "UnderwriterPartyName",  
"null\_Value": "unasSigned"  
},  
"ProducerPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ProducerPartyName",  
"null\_Value": "unasSigned"  
},  
"AgentPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "AgentPartyName",  
"null\_Value": "unasSigned"  
},  
"UnderwritingAccountPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "UnderwritingAccountPartyName",  
"null\_Value": "unasSigned"  
},  
"BranchPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "BranchPartyName",  
"null\_Value": "unasSigned"  
},  
"AccountingOrganizationPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "AccountingOrganizationPartyName",  
"null\_Value": "unasSigned"  
},  
"LegalEntityPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "LegalEntityPartyName",  
"null\_Value": "unasSigned"  
},  
"CostCenterPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "CostCenterPartyName",  
"null\_Value": "unasSigned"  
},  
"HubPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "HubPartyName",  
"null\_Value": "unasSigned"  
},  
"OfficePartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "OfficePartyName",  
"null\_Value": "unasSigned"  
},  
"MarketChannelName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "MarketChannelName",  
"null\_Value": "unasSigned"  
},  
"InceptionDate": {  
"type": "Date",  
"index": "not\_analyzed",  
"index\_Name": "InceptionDate"  
},  
"ExpirationDate": {  
"type": "Date",  
"index": "not\_analyzed",  
"index\_Name": "ExpirationDate"  
},  
"AttachmentBasisName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "AttachmentBasisName",  
"null\_Value": "unasSigned"  
},  
"AttachmentLevelName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "AttachmentLevelName",  
"null\_Value": "unasSigned"  
},  
"ClaimAdjustmentDeductibleName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ClaimAdjustmentDeductibleName",  
"null\_Value": "unasSigned"  
},  
"ClaimAdjustmentSubmitName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ClaimAdjustmentSubmitName",  
"null\_Value": "unasSigned"  
},  
"ClaimAdjustmentSublimitName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ClaimAdjustmentSublimitName",  
"null\_Value": "unasSigned"  
},  
"Premium": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "Premium"  
},  
"PaidReinstatement": {  
"type": "integer",  
"index": "not\_analyzed",  
"index\_Name": "PaidReinstatement"  
},  
"FreeReinstatement": {  
"type": "integer",  
"index": "not\_analyzed",  
"index\_Name": "FreeReinstatement"  
},  
"ReinstatementsPercentCharge": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "ReinstatementsPercentCharge"  
},  
"ReinstatementsPremium": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "ReinstatementsPremium"  
},  
"IsProRataTemporis": {  
"type": "boolean",  
"index": "not\_analyzed",  
"index\_Name": "IsProRataTemporis"  
},  
"ProductName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ProductName"  
},  
"PrimaryAccordOccupancyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "PrimaryAccordOccupancyName",  
"null\_Value": "unasSigned"  
},  
"CurrencyCode": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "CurrencyCode",  
"null\_Value": "usd"  
},  
"RenewalDate": {  
"type": "Date",  
"index": "not\_analyzed",  
"index\_Name": "RenewalDate"  
},  
"ExpectedShares": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "ExpectedShares"  
},  
"SignedShares": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "SignedShares"  
},  
"WrittenShares": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "WrittenShares"  
},  
"WhatIfName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "WhatIfName",  
"null\_Value": "main"  
},  
"ClonedExposureId": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "ClonedExposureId"  
},  
"CloneTypeId": {  
"type": "integer",  
"index": "not\_analyzed",  
"index\_Name": "CloneTypeId"  
},  
"ContractTypeIsInsurance": {  
"type": "boolean",  
"index": "not\_analyzed",  
"index\_Name": "ContractTypeIsInsurance"  
},  
"SourceId": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "SourceId"  
},  
"IsRenewal": {  
"type": "boolean",  
"index": "not\_analyzed",  
"index\_Name": "IsRenewal"  
},  
"ProductAsOfDate": {  
"type": "Date",  
"index": "not\_analyzed",  
"index\_Name": "ProductAsOfDate"  
},  
"Jurisdiction": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "Jurisdiction"  
},  
"IsCedantContract": {  
"type": "boolean",  
"index": "not\_analyzed",  
"index\_Name": "IsCedantContract"  
},  
"CalculatedTIV": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "CalculatedTIV"  
},  
"CalculatedBuildingTIV": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "CalculatedBuildingTIV"  
},  
"CalculatedContentsTIV": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "CalculatedContentsTIV"  
},  
"CalculatedBITIV": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "CalculatedBITIV"  
},  
"RiskItemCount": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "RiskItemCount"  
},  
"ACLTag": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ACLTag"  
},  
"ImportSetId": {  
"type": "integer",  
"index": "not\_analyzed",  
"index\_Name": "ImportSetId"  
}  
}  
}  
}

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ec1e384b-318a-43e8-9a94-05ecdf5f0e4a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ec1e384b-318a-43e8-9a94-05ecdf5f0e4a%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![VB1](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@VB1](https://discuss.elastic.co/u/VB1)\
**Post date:** [January 13, 2014, 10:58pm UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/2 "2014-01-13T22:58:04Z")

</div>

It is even happening with other type.

query

{  
"from": 0,  
"size": 50,  
"query": {  
"match\_all": {}  
},  
"facets": {  
"Id": {  
"statistical": {  
"fields": [  
"Id"  
]  
}  
}  
}  
}

mapping

{  
"portfoliosearch": {  
"dynamic": "strict",  
"properties": {  
"TransactionIdList": {  
"properties": {  
"transactionId": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "transactionId"  
}  
},  
"type": "nested"  
},  
"Id": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "Id"  
},  
"ExposureId": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "ExposureId"  
},  
"Name": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "Name"  
},  
"Description": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "Description"  
},  
"ExposureNumber": {  
"type": "string",  
"index": "analyzed",  
"index\_Name": "ExposureNumber"  
},  
"ExposedPartyName": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ExposedPartyName"  
},  
"CreateUserId": {  
"type": "integer",  
"index": "not\_analyzed",  
"index\_Name": "CreateUserId"  
},  
"IsDynamic": {  
"type": "boolean",  
"index": "not\_analyzed",  
"index\_Name": "IsDynamic"  
},  
"ClonedExposureId": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "ClonedExposureId"  
},  
"CloneTypeId": {  
"type": "integer",  
"index": "not\_analyzed",  
"index\_Name": "CloneTypeId"  
},  
"IsReference": {  
"type": "boolean",  
"index": "not\_analyzed",  
"index\_Name": "IsReference"  
},  
"CollExposureWhatIfTagName": {  
"type": "string",  
"index": "analyzed",  
"index\_Name": "CollExposureWhatIfTagName"  
},  
"SourceId": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "SourceId"  
},  
"CalculatedTIV": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "CalculatedTIV"  
},  
"CalculatedBuildingTIV": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "CalculatedBuildingTIV"  
},  
"CalculatedContentsTIV": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "CalculatedContentsTIV"  
},  
"CalculatedBITIV": {  
"type": "double",  
"index": "not\_analyzed",  
"index\_Name": "CalculatedBITIV"  
},  
"RiskItemCount": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "RiskItemCount"  
},  
"ContractCount": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "ContractCount"  
},  
"ACLTag": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "ACLTag"  
}  
},  
"\_routing": {  
"required": true  
},  
"\_parent": {  
"type": "importsetsearch"  
}  
}  
}

data only 4 records

{

- took: 0
- timed\_out: false
- \_shards: {
  - total: 50
  - successful: 50
  - failed: 0  
}

- hits: {
  - total: 4
  - max\_score: 1
  - hits: [
    - {
      - \_index: 4\_exposureindex
      - \_type: portfoliosearch
      - \_id: 398103
      - \_score: 1
      - \_source: {
        - CollExposureWhatIfTagName: null
        - Name: Fast Food US
        - Description: 3 Accounts, ? Locations
        - ExposureNumber: Fast Food US
        - CreateUserId: 10
        - SourceId: 8
        - IsDynamic: false
        - CloneTypeId: 0
        - IsReference: false
        - ExposedPartyName: CompanyC
        - Id: 398103
        - CalculatedTIV: 2687668209
        - CalculatedBuildingTIV: 2687668209
        - CalculatedContentsTIV: 0
        - CalculatedBITIV: 0
        - RiskItemCount: 13701
        - ContractCount: 3
        - ACLTag: null  
}  
}

    - {
      - \_index: 4\_exposureindex
      - \_type: portfoliosearch
      - \_id: 19320
      - \_score: 1
      - \_source: {
        - CollExposureWhatIfTagName: null
        - Name: ABC Commercial
        - Description: null
        - ExposureNumber: 3
        - CreateUserId: 10
        - SourceId: 1
        - IsDynamic: false
        - CloneTypeId: 0
        - IsReference: false
        - ExposedPartyName: CompanyC
        - Id: 19320
        - CalculatedTIV: 6176278530
        - CalculatedBuildingTIV: 4717779630
        - CalculatedContentsTIV: 964260300
        - CalculatedBITIV: 494238600
        - RiskItemCount: 1199
        - ContractCount: 40
        - ACLTag: null  
}  
}

    - {
      - \_index: 4\_exposureindex
      - \_type: portfoliosearch
      - \_id: 13174
      - \_score: 1
      - \_source: {
        - CollExposureWhatIfTagName: null
        - Name: RES\_EQ\_CA
        - Description: California
        - ExposureNumber: RES\_EQ\_CA
        - CreateUserId: 10
        - SourceId: 1
        - IsDynamic: false
        - CloneTypeId: 0
        - IsReference: false
        - ExposedPartyName: CompanyC
        - Id: 13174
        - CalculatedTIV: 1640804972
        - CalculatedBuildingTIV: 864306702
        - CalculatedContentsTIV: 531364533
        - CalculatedBITIV: 245133737
        - RiskItemCount: 3013
        - ContractCount: 3013
        - ACLTag: null  
}  
}

    - {
      - \_index: 4\_exposureindex
      - \_type: portfoliosearch
      - \_id: 980704
      - \_score: 1
      - \_source: {
        - CollExposureWhatIfTagName: null
        - Name: ABC Commercial
        - Description: null
        - ExposureNumber: 3
        - CreateUserId: 10
        - SourceId: 1
        - IsDynamic: false
        - CloneTypeId: 0
        - IsReference: false
        - ExposedPartyName: CompanyC
        - Id: 980704
        - CalculatedTIV: 6199310530
        - CalculatedBuildingTIV: 4711419630
        - CalculatedContentsTIV: 969644300
        - CalculatedBITIV: 518246600
        - RiskItemCount: 1199
        - ContractCount: 40
        - ACLTag: null  
}  
}  
]  
}

}

On Monday, 13 January 2014 14:34:38 UTC-8, VB wrote:

> Hello all,
> 
> I have a weird problem. When i try to run facet using following query I  
> get error that  
> PagedBytesIndexFieldData cannot be cast to  
> org.elasticsearch.index.fielddata.IndexNumericFieldData]
> 
> But my field is of long data type and I am not figure out why i am getting  
> error
> 
> This is the query
> 
> {  
> "query": {  
> "match\_all": {}  
> },  
> "facets": {  
> "Id": {  
> "statistical": {  
> "field": "Id"  
> }  
> }  
> }  
> }
> 
> And these are my mappings
> 
> {  
> "contractsearch": {  
> "dynamic": "strict",  
> "properties": {  
> "TransactionIdList": {  
> "properties": {  
> "TransactionId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "TransactionId"  
> }  
> },  
> "type": "nested"  
> },  
> "Id": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "Id"  
> },  
> "ExposureId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposureId"  
> },  
> "CreateUserId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "CreateUserId"  
> },  
> "ExternalSourceName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExternalSourceName",  
> "null\_Value": "unasSigned"  
> },  
> "Name": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Name"  
> },  
> "Description": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Description"  
> },  
> "ExposureNumber": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposureNumber"  
> },  
> "ProgramName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProgramName"  
> },  
> "ExposedPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposedPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "ContractTypeName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractTypeName",  
> "null\_Value": "unasSigned"  
> },  
> "UserDefContractTypeName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UserDefContractTypeName",  
> "null\_Value": "unasSigned"  
> },  
> "LineofBusinessName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "LineofBusinessName",  
> "null\_Value": "unasSigned"  
> },  
> "ContractStatusName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractStatusName",  
> "null\_Value": "unasSigned"  
> },  
> "InsuredPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "InsuredPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "InsurerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "InsurerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "BrokerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "BrokerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "UnderwriterPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UnderwriterPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "ProducerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProducerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "AgentPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AgentPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "UnderwritingAccountPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UnderwritingAccountPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "BranchPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "BranchPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "AccountingOrganizationPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AccountingOrganizationPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "LegalEntityPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "LegalEntityPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "CostCenterPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "CostCenterPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "HubPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "HubPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "OfficePartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "OfficePartyName",  
> "null\_Value": "unasSigned"  
> },  
> "MarketChannelName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "MarketChannelName",  
> "null\_Value": "unasSigned"  
> },  
> "InceptionDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "InceptionDate"  
> },  
> "ExpirationDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "ExpirationDate"  
> },  
> "AttachmentBasisName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AttachmentBasisName",  
> "null\_Value": "unasSigned"  
> },  
> "AttachmentLevelName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AttachmentLevelName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentDeductibleName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentDeductibleName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentSubmitName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentSubmitName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentSublimitName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentSublimitName",  
> "null\_Value": "unasSigned"  
> },  
> "Premium": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "Premium"  
> },  
> "PaidReinstatement": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "PaidReinstatement"  
> },  
> "FreeReinstatement": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "FreeReinstatement"  
> },  
> "ReinstatementsPercentCharge": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ReinstatementsPercentCharge"  
> },  
> "ReinstatementsPremium": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ReinstatementsPremium"  
> },  
> "IsProRataTemporis": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsProRataTemporis"  
> },  
> "ProductName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProductName"  
> },  
> "PrimaryAccordOccupancyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "PrimaryAccordOccupancyName",  
> "null\_Value": "unasSigned"  
> },  
> "CurrencyCode": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "CurrencyCode",  
> "null\_Value": "usd"  
> },  
> "RenewalDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "RenewalDate"  
> },  
> "ExpectedShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ExpectedShares"  
> },  
> "SignedShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "SignedShares"  
> },  
> "WrittenShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "WrittenShares"  
> },  
> "WhatIfName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "WhatIfName",  
> "null\_Value": "main"  
> },  
> "ClonedExposureId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "ClonedExposureId"  
> },  
> "CloneTypeId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "CloneTypeId"  
> },  
> "ContractTypeIsInsurance": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractTypeIsInsurance"  
> },  
> "SourceId": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "SourceId"  
> },  
> "IsRenewal": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsRenewal"  
> },  
> "ProductAsOfDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "ProductAsOfDate"  
> },  
> "Jurisdiction": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Jurisdiction"  
> },  
> "IsCedantContract": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsCedantContract"  
> },  
> "CalculatedTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedTIV"  
> },  
> "CalculatedBuildingTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedBuildingTIV"  
> },  
> "CalculatedContentsTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedContentsTIV"  
> },  
> "CalculatedBITIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedBITIV"  
> },  
> "RiskItemCount": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "RiskItemCount"  
> },  
> "ACLTag": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ACLTag"  
> },  
> "ImportSetId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "ImportSetId"  
> }  
> }  
> }  
> }

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/50cc0fed-030f-4bdc-b095-83e645e75573%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/50cc0fed-030f-4bdc-b095-83e645e75573%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![VB1](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@VB1](https://discuss.elastic.co/u/VB1)\
**Post date:** [January 13, 2014, 11:31pm UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/3 "2014-01-13T23:31:49Z")

</div>

It even happens when there is only single record matches query criteria and  
only happens with this ("Id") field. Does has to do with name of the field?

Is there something internal logic with id field.?

On Monday, 13 January 2014 14:34:38 UTC-8, VB wrote:

> Hello all,
> 
> I have a weird problem. When i try to run facet using following query I  
> get error that  
> PagedBytesIndexFieldData cannot be cast to  
> org.elasticsearch.index.fielddata.IndexNumericFieldData]
> 
> But my field is of long data type and I am not figure out why i am getting  
> error
> 
> This is the query
> 
> {  
> "query": {  
> "match\_all": {}  
> },  
> "facets": {  
> "Id": {  
> "statistical": {  
> "field": "Id"  
> }  
> }  
> }  
> }
> 
> And these are my mappings
> 
> {  
> "contractsearch": {  
> "dynamic": "strict",  
> "properties": {  
> "TransactionIdList": {  
> "properties": {  
> "TransactionId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "TransactionId"  
> }  
> },  
> "type": "nested"  
> },  
> "Id": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "Id"  
> },  
> "ExposureId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposureId"  
> },  
> "CreateUserId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "CreateUserId"  
> },  
> "ExternalSourceName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExternalSourceName",  
> "null\_Value": "unasSigned"  
> },  
> "Name": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Name"  
> },  
> "Description": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Description"  
> },  
> "ExposureNumber": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposureNumber"  
> },  
> "ProgramName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProgramName"  
> },  
> "ExposedPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposedPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "ContractTypeName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractTypeName",  
> "null\_Value": "unasSigned"  
> },  
> "UserDefContractTypeName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UserDefContractTypeName",  
> "null\_Value": "unasSigned"  
> },  
> "LineofBusinessName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "LineofBusinessName",  
> "null\_Value": "unasSigned"  
> },  
> "ContractStatusName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractStatusName",  
> "null\_Value": "unasSigned"  
> },  
> "InsuredPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "InsuredPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "InsurerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "InsurerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "BrokerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "BrokerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "UnderwriterPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UnderwriterPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "ProducerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProducerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "AgentPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AgentPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "UnderwritingAccountPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UnderwritingAccountPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "BranchPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "BranchPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "AccountingOrganizationPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AccountingOrganizationPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "LegalEntityPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "LegalEntityPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "CostCenterPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "CostCenterPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "HubPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "HubPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "OfficePartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "OfficePartyName",  
> "null\_Value": "unasSigned"  
> },  
> "MarketChannelName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "MarketChannelName",  
> "null\_Value": "unasSigned"  
> },  
> "InceptionDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "InceptionDate"  
> },  
> "ExpirationDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "ExpirationDate"  
> },  
> "AttachmentBasisName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AttachmentBasisName",  
> "null\_Value": "unasSigned"  
> },  
> "AttachmentLevelName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AttachmentLevelName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentDeductibleName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentDeductibleName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentSubmitName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentSubmitName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentSublimitName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentSublimitName",  
> "null\_Value": "unasSigned"  
> },  
> "Premium": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "Premium"  
> },  
> "PaidReinstatement": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "PaidReinstatement"  
> },  
> "FreeReinstatement": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "FreeReinstatement"  
> },  
> "ReinstatementsPercentCharge": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ReinstatementsPercentCharge"  
> },  
> "ReinstatementsPremium": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ReinstatementsPremium"  
> },  
> "IsProRataTemporis": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsProRataTemporis"  
> },  
> "ProductName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProductName"  
> },  
> "PrimaryAccordOccupancyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "PrimaryAccordOccupancyName",  
> "null\_Value": "unasSigned"  
> },  
> "CurrencyCode": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "CurrencyCode",  
> "null\_Value": "usd"  
> },  
> "RenewalDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "RenewalDate"  
> },  
> "ExpectedShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ExpectedShares"  
> },  
> "SignedShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "SignedShares"  
> },  
> "WrittenShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "WrittenShares"  
> },  
> "WhatIfName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "WhatIfName",  
> "null\_Value": "main"  
> },  
> "ClonedExposureId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "ClonedExposureId"  
> },  
> "CloneTypeId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "CloneTypeId"  
> },  
> "ContractTypeIsInsurance": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractTypeIsInsurance"  
> },  
> "SourceId": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "SourceId"  
> },  
> "IsRenewal": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsRenewal"  
> },  
> "ProductAsOfDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "ProductAsOfDate"  
> },  
> "Jurisdiction": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Jurisdiction"  
> },  
> "IsCedantContract": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsCedantContract"  
> },  
> "CalculatedTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedTIV"  
> },  
> "CalculatedBuildingTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedBuildingTIV"  
> },  
> "CalculatedContentsTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedContentsTIV"  
> },  
> "CalculatedBITIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedBITIV"  
> },  
> "RiskItemCount": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "RiskItemCount"  
> },  
> "ACLTag": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ACLTag"  
> },  
> "ImportSetId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "ImportSetId"  
> }  
> }  
> }  
> }

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fdc98724-bfac-4893-9630-750ca7f43857%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fdc98724-bfac-4893-9630-750ca7f43857%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![VB1](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@VB1](https://discuss.elastic.co/u/VB1)\
**Post date:** [January 14, 2014, 12:40am UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/4 "2014-01-14T00:40:57Z")

</div>

Can someone please help here. We are stuck at this point.

On Monday, 13 January 2014 15:31:49 UTC-8, VB wrote:

> It even happens when there is only single record matches query criteria  
> and only happens with this ("Id") field. Does has to do with name of the  
> field?
> 
> Is there something internal logic with id field.?
> 
> On Monday, 13 January 2014 14:34:38 UTC-8, VB wrote:
> 
> > Hello all,
> > 
> > I have a weird problem. When i try to run facet using following query I  
> > get error that  
> > PagedBytesIndexFieldData cannot be cast to  
> > org.elasticsearch.index.fielddata.IndexNumericFieldData]
> > 
> > But my field is of long data type and I am not figure out why i am  
> > getting error
> > 
> > This is the query
> > 
> > {  
> > "query": {  
> > "match\_all": {}  
> > },  
> > "facets": {  
> > "Id": {  
> > "statistical": {  
> > "field": "Id"  
> > }  
> > }  
> > }  
> > }
> > 
> > And these are my mappings
> > 
> > {  
> > "contractsearch": {  
> > "dynamic": "strict",  
> > "properties": {  
> > "TransactionIdList": {  
> > "properties": {  
> > "TransactionId": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "TransactionId"  
> > }  
> > },  
> > "type": "nested"  
> > },  
> > "Id": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Id"  
> > },  
> > "ExposureId": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExposureId"  
> > },  
> > "CreateUserId": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CreateUserId"  
> > },  
> > "ExternalSourceName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExternalSourceName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "Name": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Name"  
> > },  
> > "Description": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Description"  
> > },  
> > "ExposureNumber": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExposureNumber"  
> > },  
> > "ProgramName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ProgramName"  
> > },  
> > "ExposedPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExposedPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ContractTypeName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ContractTypeName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "UserDefContractTypeName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "UserDefContractTypeName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "LineofBusinessName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "LineofBusinessName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ContractStatusName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ContractStatusName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "InsuredPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "InsuredPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "InsurerPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "InsurerPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "BrokerPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "BrokerPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "UnderwriterPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "UnderwriterPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ProducerPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ProducerPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "AgentPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "AgentPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "UnderwritingAccountPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "UnderwritingAccountPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "BranchPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "BranchPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "AccountingOrganizationPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "AccountingOrganizationPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "LegalEntityPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "LegalEntityPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "CostCenterPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CostCenterPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "HubPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "HubPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "OfficePartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "OfficePartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "MarketChannelName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "MarketChannelName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "InceptionDate": {  
> > "type": "Date",  
> > "index": "not\_analyzed",  
> > "index\_Name": "InceptionDate"  
> > },  
> > "ExpirationDate": {  
> > "type": "Date",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExpirationDate"  
> > },  
> > "AttachmentBasisName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "AttachmentBasisName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "AttachmentLevelName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "AttachmentLevelName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ClaimAdjustmentDeductibleName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ClaimAdjustmentDeductibleName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ClaimAdjustmentSubmitName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ClaimAdjustmentSubmitName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ClaimAdjustmentSublimitName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ClaimAdjustmentSublimitName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "Premium": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Premium"  
> > },  
> > "PaidReinstatement": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "PaidReinstatement"  
> > },  
> > "FreeReinstatement": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "FreeReinstatement"  
> > },  
> > "ReinstatementsPercentCharge": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ReinstatementsPercentCharge"  
> > },  
> > "ReinstatementsPremium": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ReinstatementsPremium"  
> > },  
> > "IsProRataTemporis": {  
> > "type": "boolean",  
> > "index": "not\_analyzed",  
> > "index\_Name": "IsProRataTemporis"  
> > },  
> > "ProductName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ProductName"  
> > },  
> > "PrimaryAccordOccupancyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "PrimaryAccordOccupancyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "CurrencyCode": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CurrencyCode",  
> > "null\_Value": "usd"  
> > },  
> > "RenewalDate": {  
> > "type": "Date",  
> > "index": "not\_analyzed",  
> > "index\_Name": "RenewalDate"  
> > },  
> > "ExpectedShares": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExpectedShares"  
> > },  
> > "SignedShares": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "SignedShares"  
> > },  
> > "WrittenShares": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "WrittenShares"  
> > },  
> > "WhatIfName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "WhatIfName",  
> > "null\_Value": "main"  
> > },  
> > "ClonedExposureId": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ClonedExposureId"  
> > },  
> > "CloneTypeId": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CloneTypeId"  
> > },  
> > "ContractTypeIsInsurance": {  
> > "type": "boolean",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ContractTypeIsInsurance"  
> > },  
> > "SourceId": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "SourceId"  
> > },  
> > "IsRenewal": {  
> > "type": "boolean",  
> > "index": "not\_analyzed",  
> > "index\_Name": "IsRenewal"  
> > },  
> > "ProductAsOfDate": {  
> > "type": "Date",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ProductAsOfDate"  
> > },  
> > "Jurisdiction": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Jurisdiction"  
> > },  
> > "IsCedantContract": {  
> > "type": "boolean",  
> > "index": "not\_analyzed",  
> > "index\_Name": "IsCedantContract"  
> > },  
> > "CalculatedTIV": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CalculatedTIV"  
> > },  
> > "CalculatedBuildingTIV": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CalculatedBuildingTIV"  
> > },  
> > "CalculatedContentsTIV": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CalculatedContentsTIV"  
> > },  
> > "CalculatedBITIV": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CalculatedBITIV"  
> > },  
> > "RiskItemCount": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "RiskItemCount"  
> > },  
> > "ACLTag": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ACLTag"  
> > },  
> > "ImportSetId": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ImportSetId"  
> > }  
> > }  
> > }  
> > }

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3fc55f5f-332b-4975-8ac4-f6747a2333c0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3fc55f5f-332b-4975-8ac4-f6747a2333c0%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 14, 2014, 12:09pm UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/5 "2014-01-14T12:09:25Z")

</div>

Hey,

is it possible, that your query spans several indices, where one of this  
indices is actually having an id field mapping to something else than a  
number?  
Can you limit your query to one index only and retry?  
Can you otherwise create a gist to reproduce it locally?

--Alex

On Tue, Jan 14, 2014 at 1:40 AM, VB [vishal.batghare@gmail.com](mailto:vishal.batghare@gmail.com) wrote:

> Can someone please help here. We are stuck at this point.
> 
> On Monday, 13 January 2014 15:31:49 UTC-8, VB wrote:
> 
> > It even happens when there is only single record matches query criteria  
> > and only happens with this ("Id") field. Does has to do with name of the  
> > field?
> > 
> > Is there something internal logic with id field.?
> > 
> > On Monday, 13 January 2014 14:34:38 UTC-8, VB wrote:
> > 
> > > Hello all,
> > > 
> > > I have a weird problem. When i try to run facet using following query I  
> > > get error that  
> > > PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.  
> > > fielddata.IndexNumericFieldData]
> > > 
> > > But my field is of long data type and I am not figure out why i am  
> > > getting error
> > > 
> > > This is the query
> > > 
> > > {  
> > > "query": {  
> > > "match\_all": {}  
> > > },  
> > > "facets": {  
> > > "Id": {  
> > > "statistical": {  
> > > "field": "Id"  
> > > }  
> > > }  
> > > }  
> > > }
> > > 
> > > And these are my mappings
> > > 
> > > {  
> > > "contractsearch": {  
> > > "dynamic": "strict",  
> > > "properties": {  
> > > "TransactionIdList": {  
> > > "properties": {  
> > > "TransactionId": {  
> > > "type": "long",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "TransactionId"  
> > > }  
> > > },  
> > > "type": "nested"  
> > > },  
> > > "Id": {  
> > > "type": "long",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "Id"  
> > > },  
> > > "ExposureId": {  
> > > "type": "long",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ExposureId"  
> > > },  
> > > "CreateUserId": {  
> > > "type": "integer",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "CreateUserId"  
> > > },  
> > > "ExternalSourceName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ExternalSourceName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "Name": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "Name"  
> > > },  
> > > "Description": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "Description"  
> > > },  
> > > "ExposureNumber": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ExposureNumber"  
> > > },  
> > > "ProgramName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ProgramName"  
> > > },  
> > > "ExposedPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ExposedPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "ContractTypeName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ContractTypeName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "UserDefContractTypeName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "UserDefContractTypeName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "LineofBusinessName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "LineofBusinessName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "ContractStatusName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ContractStatusName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "InsuredPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "InsuredPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "InsurerPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "InsurerPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "BrokerPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "BrokerPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "UnderwriterPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "UnderwriterPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "ProducerPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ProducerPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "AgentPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "AgentPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "UnderwritingAccountPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "UnderwritingAccountPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "BranchPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "BranchPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "AccountingOrganizationPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "AccountingOrganizationPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "LegalEntityPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "LegalEntityPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "CostCenterPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "CostCenterPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "HubPartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "HubPartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "OfficePartyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "OfficePartyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "MarketChannelName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "MarketChannelName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "InceptionDate": {  
> > > "type": "Date",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "InceptionDate"  
> > > },  
> > > "ExpirationDate": {  
> > > "type": "Date",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ExpirationDate"  
> > > },  
> > > "AttachmentBasisName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "AttachmentBasisName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "AttachmentLevelName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "AttachmentLevelName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "ClaimAdjustmentDeductibleName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ClaimAdjustmentDeductibleName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "ClaimAdjustmentSubmitName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ClaimAdjustmentSubmitName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "ClaimAdjustmentSublimitName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ClaimAdjustmentSublimitName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "Premium": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "Premium"  
> > > },  
> > > "PaidReinstatement": {  
> > > "type": "integer",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "PaidReinstatement"  
> > > },  
> > > "FreeReinstatement": {  
> > > "type": "integer",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "FreeReinstatement"  
> > > },  
> > > "ReinstatementsPercentCharge": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ReinstatementsPercentCharge"  
> > > },  
> > > "ReinstatementsPremium": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ReinstatementsPremium"  
> > > },  
> > > "IsProRataTemporis": {  
> > > "type": "boolean",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "IsProRataTemporis"  
> > > },  
> > > "ProductName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ProductName"  
> > > },  
> > > "PrimaryAccordOccupancyName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "PrimaryAccordOccupancyName",  
> > > "null\_Value": "unasSigned"  
> > > },  
> > > "CurrencyCode": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "CurrencyCode",  
> > > "null\_Value": "usd"  
> > > },  
> > > "RenewalDate": {  
> > > "type": "Date",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "RenewalDate"  
> > > },  
> > > "ExpectedShares": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ExpectedShares"  
> > > },  
> > > "SignedShares": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "SignedShares"  
> > > },  
> > > "WrittenShares": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "WrittenShares"  
> > > },  
> > > "WhatIfName": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "WhatIfName",  
> > > "null\_Value": "main"  
> > > },  
> > > "ClonedExposureId": {  
> > > "type": "long",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ClonedExposureId"  
> > > },  
> > > "CloneTypeId": {  
> > > "type": "integer",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "CloneTypeId"  
> > > },  
> > > "ContractTypeIsInsurance": {  
> > > "type": "boolean",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ContractTypeIsInsurance"  
> > > },  
> > > "SourceId": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "SourceId"  
> > > },  
> > > "IsRenewal": {  
> > > "type": "boolean",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "IsRenewal"  
> > > },  
> > > "ProductAsOfDate": {  
> > > "type": "Date",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ProductAsOfDate"  
> > > },  
> > > "Jurisdiction": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "Jurisdiction"  
> > > },  
> > > "IsCedantContract": {  
> > > "type": "boolean",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "IsCedantContract"  
> > > },  
> > > "CalculatedTIV": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "CalculatedTIV"  
> > > },  
> > > "CalculatedBuildingTIV": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "CalculatedBuildingTIV"  
> > > },  
> > > "CalculatedContentsTIV": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "CalculatedContentsTIV"  
> > > },  
> > > "CalculatedBITIV": {  
> > > "type": "double",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "CalculatedBITIV"  
> > > },  
> > > "RiskItemCount": {  
> > > "type": "long",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "RiskItemCount"  
> > > },  
> > > "ACLTag": {  
> > > "type": "string",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ACLTag"  
> > > },  
> > > "ImportSetId": {  
> > > "type": "integer",  
> > > "index": "not\_analyzed",  
> > > "index\_Name": "ImportSetId"  
> > > }  
> > > }  
> > > }  
> > > }
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/3fc55f5f-332b-4975-8ac4-f6747a2333c0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3fc55f5f-332b-4975-8ac4-f6747a2333c0%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM87p8C-1eDs5O%3DtiFMbkQM0D2881Vt5ATtRWhDWTdpbsA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM87p8C-1eDs5O%3DtiFMbkQM0D2881Vt5ATtRWhDWTdpbsA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![VB1](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@VB1](https://discuss.elastic.co/u/VB1)\
**Post date:** [January 14, 2014, 4:16pm UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/6 "2014-01-14T16:16:39Z")

</div>

Actually it is not.

I tried with another type which only 4 records and it was still giving same error.

Sent from my iPhone

> On Jan 14, 2014, at 4:09 AM, Alexander Reelsen [alr@spinscale.de](mailto:alr@spinscale.de) wrote:
> 
> Hey,
> 
> is it possible, that your query spans several indices, where one of this indices is actually having an id field mapping to something else than a number?  
> Can you limit your query to one index only and retry?  
> Can you otherwise create a gist to reproduce it locally?
> 
> --Alex
> 
> > On Tue, Jan 14, 2014 at 1:40 AM, VB [vishal.batghare@gmail.com](mailto:vishal.batghare@gmail.com) wrote:  
> > Can someone please help here. We are stuck at this point.
> > 
> > > On Monday, 13 January 2014 15:31:49 UTC-8, VB wrote:  
> > > It even happens when there is only single record matches query criteria and only happens with this ("Id") field. Does has to do with name of the field?
> > > 
> > > Is there something internal logic with id field.?
> > > 
> > > > On Monday, 13 January 2014 14:34:38 UTC-8, VB wrote:  
> > > > Hello all,
> > > > 
> > > > I have a weird problem. When i try to run facet using following query I get error that  
> > > > PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]
> > > > 
> > > > But my field is of long data type and I am not figure out why i am getting error
> > > > 
> > > > This is the query
> > > > 
> > > > {  
> > > > "query": {  
> > > > "match\_all": {}  
> > > > },  
> > > > "facets": {  
> > > > "Id": {  
> > > > "statistical": {  
> > > > "field": "Id"  
> > > > }  
> > > > }  
> > > > }  
> > > > }
> > > > 
> > > > And these are my mappings
> > > > 
> > > > {  
> > > > "contractsearch": {  
> > > > "dynamic": "strict",  
> > > > "properties": {  
> > > > "TransactionIdList": {  
> > > > "properties": {  
> > > > "TransactionId": {  
> > > > "type": "long",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "TransactionId"  
> > > > }  
> > > > },  
> > > > "type": "nested"  
> > > > },  
> > > > "Id": {  
> > > > "type": "long",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "Id"  
> > > > },  
> > > > "ExposureId": {  
> > > > "type": "long",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ExposureId"  
> > > > },  
> > > > "CreateUserId": {  
> > > > "type": "integer",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "CreateUserId"  
> > > > },  
> > > > "ExternalSourceName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ExternalSourceName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "Name": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "Name"  
> > > > },  
> > > > "Description": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "Description"  
> > > > },  
> > > > "ExposureNumber": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ExposureNumber"  
> > > > },  
> > > > "ProgramName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ProgramName"  
> > > > },  
> > > > "ExposedPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ExposedPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "ContractTypeName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ContractTypeName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "UserDefContractTypeName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "UserDefContractTypeName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "LineofBusinessName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "LineofBusinessName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "ContractStatusName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ContractStatusName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "InsuredPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "InsuredPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "InsurerPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "InsurerPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "BrokerPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "BrokerPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "UnderwriterPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "UnderwriterPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "ProducerPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ProducerPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "AgentPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "AgentPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "UnderwritingAccountPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "UnderwritingAccountPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "BranchPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "BranchPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "AccountingOrganizationPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "AccountingOrganizationPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "LegalEntityPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "LegalEntityPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "CostCenterPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "CostCenterPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "HubPartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "HubPartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "OfficePartyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "OfficePartyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "MarketChannelName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "MarketChannelName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "InceptionDate": {  
> > > > "type": "Date",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "InceptionDate"  
> > > > },  
> > > > "ExpirationDate": {  
> > > > "type": "Date",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ExpirationDate"  
> > > > },  
> > > > "AttachmentBasisName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "AttachmentBasisName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "AttachmentLevelName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "AttachmentLevelName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "ClaimAdjustmentDeductibleName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ClaimAdjustmentDeductibleName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "ClaimAdjustmentSubmitName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ClaimAdjustmentSubmitName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "ClaimAdjustmentSublimitName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ClaimAdjustmentSublimitName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "Premium": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "Premium"  
> > > > },  
> > > > "PaidReinstatement": {  
> > > > "type": "integer",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "PaidReinstatement"  
> > > > },  
> > > > "FreeReinstatement": {  
> > > > "type": "integer",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "FreeReinstatement"  
> > > > },  
> > > > "ReinstatementsPercentCharge": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ReinstatementsPercentCharge"  
> > > > },  
> > > > "ReinstatementsPremium": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ReinstatementsPremium"  
> > > > },  
> > > > "IsProRataTemporis": {  
> > > > "type": "boolean",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "IsProRataTemporis"  
> > > > },  
> > > > "ProductName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ProductName"  
> > > > },  
> > > > "PrimaryAccordOccupancyName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "PrimaryAccordOccupancyName",  
> > > > "null\_Value": "unasSigned"  
> > > > },  
> > > > "CurrencyCode": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "CurrencyCode",  
> > > > "null\_Value": "usd"  
> > > > },  
> > > > "RenewalDate": {  
> > > > "type": "Date",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "RenewalDate"  
> > > > },  
> > > > "ExpectedShares": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ExpectedShares"  
> > > > },  
> > > > "SignedShares": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "SignedShares"  
> > > > },  
> > > > "WrittenShares": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "WrittenShares"  
> > > > },  
> > > > "WhatIfName": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "WhatIfName",  
> > > > "null\_Value": "main"  
> > > > },  
> > > > "ClonedExposureId": {  
> > > > "type": "long",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ClonedExposureId"  
> > > > },  
> > > > "CloneTypeId": {  
> > > > "type": "integer",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "CloneTypeId"  
> > > > },  
> > > > "ContractTypeIsInsurance": {  
> > > > "type": "boolean",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ContractTypeIsInsurance"  
> > > > },  
> > > > "SourceId": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "SourceId"  
> > > > },  
> > > > "IsRenewal": {  
> > > > "type": "boolean",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "IsRenewal"  
> > > > },  
> > > > "ProductAsOfDate": {  
> > > > "type": "Date",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ProductAsOfDate"  
> > > > },  
> > > > "Jurisdiction": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "Jurisdiction"  
> > > > },  
> > > > "IsCedantContract": {  
> > > > "type": "boolean",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "IsCedantContract"  
> > > > },  
> > > > "CalculatedTIV": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "CalculatedTIV"  
> > > > },  
> > > > "CalculatedBuildingTIV": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "CalculatedBuildingTIV"  
> > > > },  
> > > > "CalculatedContentsTIV": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "CalculatedContentsTIV"  
> > > > },  
> > > > "CalculatedBITIV": {  
> > > > "type": "double",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "CalculatedBITIV"  
> > > > },  
> > > > "RiskItemCount": {  
> > > > "type": "long",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "RiskItemCount"  
> > > > },  
> > > > "ACLTag": {  
> > > > "type": "string",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ACLTag"  
> > > > },  
> > > > "ImportSetId": {  
> > > > "type": "integer",  
> > > > "index": "not\_analyzed",  
> > > > "index\_Name": "ImportSetId"  
> > > > }  
> > > > }  
> > > > }  
> > > > }
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3fc55f5f-332b-4975-8ac4-f6747a2333c0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3fc55f5f-332b-4975-8ac4-f6747a2333c0%40googlegroups.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 a topic in the Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/QOnRAd4X\_AE/unsubscribe](https://groups.google.com/d/topic/elasticsearch/QOnRAd4X_AE/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM87p8C-1eDs5O%3DtiFMbkQM0D2881Vt5ATtRWhDWTdpbsA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM87p8C-1eDs5O%3DtiFMbkQM0D2881Vt5ATtRWhDWTdpbsA%40mail.gmail.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/AFAE777A-2797-41CF-972C-2F332B4842FD%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/AFAE777A-2797-41CF-972C-2F332B4842FD%40gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![VB1](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@VB1](https://discuss.elastic.co/u/VB1)\
**Post date:** [January 17, 2014, 5:47pm UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/7 "2014-01-17T17:47:55Z")

</div>

we are still facing this issue on and off.

can someone please help.

On Monday, 13 January 2014 14:34:38 UTC-8, VB wrote:

> Hello all,
> 
> I have a weird problem. When i try to run facet using following query I  
> get error that  
> PagedBytesIndexFieldData cannot be cast to  
> org.elasticsearch.index.fielddata.IndexNumericFieldData]
> 
> But my field is of long data type and I am not figure out why i am getting  
> error
> 
> This is the query
> 
> {  
> "query": {  
> "match\_all": {}  
> },  
> "facets": {  
> "Id": {  
> "statistical": {  
> "field": "Id"  
> }  
> }  
> }  
> }
> 
> And these are my mappings
> 
> {  
> "contractsearch": {  
> "dynamic": "strict",  
> "properties": {  
> "TransactionIdList": {  
> "properties": {  
> "TransactionId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "TransactionId"  
> }  
> },  
> "type": "nested"  
> },  
> "Id": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "Id"  
> },  
> "ExposureId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposureId"  
> },  
> "CreateUserId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "CreateUserId"  
> },  
> "ExternalSourceName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExternalSourceName",  
> "null\_Value": "unasSigned"  
> },  
> "Name": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Name"  
> },  
> "Description": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Description"  
> },  
> "ExposureNumber": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposureNumber"  
> },  
> "ProgramName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProgramName"  
> },  
> "ExposedPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ExposedPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "ContractTypeName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractTypeName",  
> "null\_Value": "unasSigned"  
> },  
> "UserDefContractTypeName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UserDefContractTypeName",  
> "null\_Value": "unasSigned"  
> },  
> "LineofBusinessName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "LineofBusinessName",  
> "null\_Value": "unasSigned"  
> },  
> "ContractStatusName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractStatusName",  
> "null\_Value": "unasSigned"  
> },  
> "InsuredPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "InsuredPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "InsurerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "InsurerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "BrokerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "BrokerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "UnderwriterPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UnderwriterPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "ProducerPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProducerPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "AgentPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AgentPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "UnderwritingAccountPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "UnderwritingAccountPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "BranchPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "BranchPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "AccountingOrganizationPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AccountingOrganizationPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "LegalEntityPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "LegalEntityPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "CostCenterPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "CostCenterPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "HubPartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "HubPartyName",  
> "null\_Value": "unasSigned"  
> },  
> "OfficePartyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "OfficePartyName",  
> "null\_Value": "unasSigned"  
> },  
> "MarketChannelName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "MarketChannelName",  
> "null\_Value": "unasSigned"  
> },  
> "InceptionDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "InceptionDate"  
> },  
> "ExpirationDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "ExpirationDate"  
> },  
> "AttachmentBasisName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AttachmentBasisName",  
> "null\_Value": "unasSigned"  
> },  
> "AttachmentLevelName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "AttachmentLevelName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentDeductibleName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentDeductibleName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentSubmitName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentSubmitName",  
> "null\_Value": "unasSigned"  
> },  
> "ClaimAdjustmentSublimitName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ClaimAdjustmentSublimitName",  
> "null\_Value": "unasSigned"  
> },  
> "Premium": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "Premium"  
> },  
> "PaidReinstatement": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "PaidReinstatement"  
> },  
> "FreeReinstatement": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "FreeReinstatement"  
> },  
> "ReinstatementsPercentCharge": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ReinstatementsPercentCharge"  
> },  
> "ReinstatementsPremium": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ReinstatementsPremium"  
> },  
> "IsProRataTemporis": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsProRataTemporis"  
> },  
> "ProductName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ProductName"  
> },  
> "PrimaryAccordOccupancyName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "PrimaryAccordOccupancyName",  
> "null\_Value": "unasSigned"  
> },  
> "CurrencyCode": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "CurrencyCode",  
> "null\_Value": "usd"  
> },  
> "RenewalDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "RenewalDate"  
> },  
> "ExpectedShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "ExpectedShares"  
> },  
> "SignedShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "SignedShares"  
> },  
> "WrittenShares": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "WrittenShares"  
> },  
> "WhatIfName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "WhatIfName",  
> "null\_Value": "main"  
> },  
> "ClonedExposureId": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "ClonedExposureId"  
> },  
> "CloneTypeId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "CloneTypeId"  
> },  
> "ContractTypeIsInsurance": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "ContractTypeIsInsurance"  
> },  
> "SourceId": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "SourceId"  
> },  
> "IsRenewal": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsRenewal"  
> },  
> "ProductAsOfDate": {  
> "type": "Date",  
> "index": "not\_analyzed",  
> "index\_Name": "ProductAsOfDate"  
> },  
> "Jurisdiction": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "Jurisdiction"  
> },  
> "IsCedantContract": {  
> "type": "boolean",  
> "index": "not\_analyzed",  
> "index\_Name": "IsCedantContract"  
> },  
> "CalculatedTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedTIV"  
> },  
> "CalculatedBuildingTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedBuildingTIV"  
> },  
> "CalculatedContentsTIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedContentsTIV"  
> },  
> "CalculatedBITIV": {  
> "type": "double",  
> "index": "not\_analyzed",  
> "index\_Name": "CalculatedBITIV"  
> },  
> "RiskItemCount": {  
> "type": "long",  
> "index": "not\_analyzed",  
> "index\_Name": "RiskItemCount"  
> },  
> "ACLTag": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "index\_Name": "ACLTag"  
> },  
> "ImportSetId": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "index\_Name": "ImportSetId"  
> }  
> }  
> }  
> }

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/296c39dc-1ad3-43e6-85e7-6f6ed3e34eee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/296c39dc-1ad3-43e6-85e7-6f6ed3e34eee%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 20, 2014, 9:30am UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/8 "2014-01-20T09:30:45Z")

</div>

Hey,

again, can you create a gist, so other people can reproduce it locally (a  
minimal example, so please strip out everything as needed, but still show  
the error)? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
The more information you give, the more likely you will get help. Thanks!

--Alex

On Fri, Jan 17, 2014 at 6:47 PM, VB [vishal.batghare@gmail.com](mailto:vishal.batghare@gmail.com) wrote:

> we are still facing this issue on and off.
> 
> can someone please help.
> 
> On Monday, 13 January 2014 14:34:38 UTC-8, VB wrote:
> 
> > Hello all,
> > 
> > I have a weird problem. When i try to run facet using following query I  
> > get error that  
> > PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.  
> > fielddata.IndexNumericFieldData]
> > 
> > But my field is of long data type and I am not figure out why i am  
> > getting error
> > 
> > This is the query
> > 
> > {  
> > "query": {  
> > "match\_all": {}  
> > },  
> > "facets": {  
> > "Id": {  
> > "statistical": {  
> > "field": "Id"  
> > }  
> > }  
> > }  
> > }
> > 
> > And these are my mappings
> > 
> > {  
> > "contractsearch": {  
> > "dynamic": "strict",  
> > "properties": {  
> > "TransactionIdList": {  
> > "properties": {  
> > "TransactionId": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "TransactionId"  
> > }  
> > },  
> > "type": "nested"  
> > },  
> > "Id": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Id"  
> > },  
> > "ExposureId": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExposureId"  
> > },  
> > "CreateUserId": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CreateUserId"  
> > },  
> > "ExternalSourceName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExternalSourceName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "Name": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Name"  
> > },  
> > "Description": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Description"  
> > },  
> > "ExposureNumber": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExposureNumber"  
> > },  
> > "ProgramName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ProgramName"  
> > },  
> > "ExposedPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExposedPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ContractTypeName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ContractTypeName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "UserDefContractTypeName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "UserDefContractTypeName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "LineofBusinessName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "LineofBusinessName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ContractStatusName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ContractStatusName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "InsuredPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "InsuredPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "InsurerPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "InsurerPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "BrokerPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "BrokerPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "UnderwriterPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "UnderwriterPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ProducerPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ProducerPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "AgentPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "AgentPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "UnderwritingAccountPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "UnderwritingAccountPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "BranchPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "BranchPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "AccountingOrganizationPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "AccountingOrganizationPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "LegalEntityPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "LegalEntityPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "CostCenterPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CostCenterPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "HubPartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "HubPartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "OfficePartyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "OfficePartyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "MarketChannelName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "MarketChannelName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "InceptionDate": {  
> > "type": "Date",  
> > "index": "not\_analyzed",  
> > "index\_Name": "InceptionDate"  
> > },  
> > "ExpirationDate": {  
> > "type": "Date",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExpirationDate"  
> > },  
> > "AttachmentBasisName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "AttachmentBasisName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "AttachmentLevelName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "AttachmentLevelName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ClaimAdjustmentDeductibleName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ClaimAdjustmentDeductibleName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ClaimAdjustmentSubmitName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ClaimAdjustmentSubmitName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "ClaimAdjustmentSublimitName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ClaimAdjustmentSublimitName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "Premium": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Premium"  
> > },  
> > "PaidReinstatement": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "PaidReinstatement"  
> > },  
> > "FreeReinstatement": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "FreeReinstatement"  
> > },  
> > "ReinstatementsPercentCharge": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ReinstatementsPercentCharge"  
> > },  
> > "ReinstatementsPremium": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ReinstatementsPremium"  
> > },  
> > "IsProRataTemporis": {  
> > "type": "boolean",  
> > "index": "not\_analyzed",  
> > "index\_Name": "IsProRataTemporis"  
> > },  
> > "ProductName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ProductName"  
> > },  
> > "PrimaryAccordOccupancyName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "PrimaryAccordOccupancyName",  
> > "null\_Value": "unasSigned"  
> > },  
> > "CurrencyCode": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CurrencyCode",  
> > "null\_Value": "usd"  
> > },  
> > "RenewalDate": {  
> > "type": "Date",  
> > "index": "not\_analyzed",  
> > "index\_Name": "RenewalDate"  
> > },  
> > "ExpectedShares": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ExpectedShares"  
> > },  
> > "SignedShares": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "SignedShares"  
> > },  
> > "WrittenShares": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "WrittenShares"  
> > },  
> > "WhatIfName": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "WhatIfName",  
> > "null\_Value": "main"  
> > },  
> > "ClonedExposureId": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ClonedExposureId"  
> > },  
> > "CloneTypeId": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CloneTypeId"  
> > },  
> > "ContractTypeIsInsurance": {  
> > "type": "boolean",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ContractTypeIsInsurance"  
> > },  
> > "SourceId": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "SourceId"  
> > },  
> > "IsRenewal": {  
> > "type": "boolean",  
> > "index": "not\_analyzed",  
> > "index\_Name": "IsRenewal"  
> > },  
> > "ProductAsOfDate": {  
> > "type": "Date",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ProductAsOfDate"  
> > },  
> > "Jurisdiction": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "Jurisdiction"  
> > },  
> > "IsCedantContract": {  
> > "type": "boolean",  
> > "index": "not\_analyzed",  
> > "index\_Name": "IsCedantContract"  
> > },  
> > "CalculatedTIV": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CalculatedTIV"  
> > },  
> > "CalculatedBuildingTIV": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CalculatedBuildingTIV"  
> > },  
> > "CalculatedContentsTIV": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CalculatedContentsTIV"  
> > },  
> > "CalculatedBITIV": {  
> > "type": "double",  
> > "index": "not\_analyzed",  
> > "index\_Name": "CalculatedBITIV"  
> > },  
> > "RiskItemCount": {  
> > "type": "long",  
> > "index": "not\_analyzed",  
> > "index\_Name": "RiskItemCount"  
> > },  
> > "ACLTag": {  
> > "type": "string",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ACLTag"  
> > },  
> > "ImportSetId": {  
> > "type": "integer",  
> > "index": "not\_analyzed",  
> > "index\_Name": "ImportSetId"  
> > }  
> > }  
> > }  
> > }
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/296c39dc-1ad3-43e6-85e7-6f6ed3e34eee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/296c39dc-1ad3-43e6-85e7-6f6ed3e34eee%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-Ui3TuUvMNbJvXLTF9xfBwp3NSOT9oSRf1cAwakR6uOA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-Ui3TuUvMNbJvXLTF9xfBwp3NSOT9oSRf1cAwakR6uOA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![VB1](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@VB1](https://discuss.elastic.co/u/VB1)\
**Post date:** [January 20, 2014, 9:18pm UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/9 "2014-01-20T21:18:54Z")

</div>

Sure thing here are the detail.

We have type with following mapping with "dynamic": "strict" so other  
datatype data can let go in. Note, it has a field "Id" with long datatype.

When we try to get statistical facet on Id it gives error\* PagedBytesIndexFieldData  
cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]\*

And it happens randomly, once I wipe out index and create it again, it  
works for some time and then all of a sudden it start giving error.

{  
"portfoliosearch": {  
"dynamic": "strict",  
"properties": {  
"Id": {  
"type": "long",  
"index": "not\_analyzed",  
"index\_Name": "Id"  
}  
"Name": {  
"type": "string",  
"index": "not\_analyzed",  
"index\_Name": "Name"  
}  
},  
"\_routing": {  
"required": true  
},  
"\_parent": {  
"type": "importsetsearch"  
}  
}  
}

statistical query

{  
"query": {  
"match\_all": {}  
},  
"facets": {  
"Id": {  
"statistical": {  
"field": "Id"  
}  
}  
}  
}

> 

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fe471294-43c7-48b8-ab6a-0248f8c1d6a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fe471294-43c7-48b8-ab6a-0248f8c1d6a0%40googlegroups.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, 1:55am UTC](https://discuss.elastic.co/t/pagedbytesindexfielddata-cannot-be-cast-to-indexnumericfielddata/15227/10 "2017-07-06T01:55:46Z")

</div>


