Termsstats / stats facets giving ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData]

Hi,

I am using elasticsearch.0.90.0.RC1, and I am unable to use termstatsfacet
and statistical-facet,

Do they require any specfic fields mappings?

Using statistical-facet
{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "campaign_id.id"
}
}
}
}

Using termstatsfacet
{
"query": {
"match_all" : { }
},
"facets": {
"campaign_stats": {
"terms_stats": {
"key_field": "campaign_id.id",
"value_field": "amount.ll"
}
}
}
}

Both gives the same exception
nested:
ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData
cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData];
}]","status":500

What I need to do to make it work?

Thanks
-Maaz

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

hey can you provide your mapping please and maybe the exception that is in
the log files?

simon

On Tuesday, April 9, 2013 2:56:28 PM UTC+2, Maaz Bin Tariq wrote:

Hi,

I am using elasticsearch.0.90.0.RC1, and I am unable to use termstatsfacet
and statistical-facet,

Do they require any specfic fields mappings?

Using statistical-facet
{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "campaign_id.id"
}
}
}
}

Using termstatsfacet
{
"query": {
"match_all" : { }
},
"facets": {
"campaign_stats": {
"terms_stats": {
"key_field": "campaign_id.id",
"value_field": "amount.ll"
}
}
}
}

Both gives the same exception
nested:
ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData
cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData];
}]","status":500

What I need to do to make it work?

Thanks
-Maaz

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Mappings

{
"pledge": {
"properties": {
"amount": {
"properties": {
"ll": {
"type": "long"
}
}
},
"campaign_id": {
"properties": {
"id": {
"type": "long"
}
}
},
"user": {
"properties": {
"id": {
"type": "string"
}
}
}
}
}
}
*
*
Exception in log files
Parse Failure [Failed to parse source [{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "_id"
}
}
}
}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:566)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:481)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:466)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:236)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException:
org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be
cast to org.elasticsearch.index.fielddata.IndexNumericFieldData
at
org.elasticsearch.search.facet.statistical.StatisticalFacetParser.parse(StatisticalFacetParser.java:119)
at
org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:554)
... 11 more

On Tue, Apr 9, 2013 at 6:36 PM, simonw simon.willnauer@elasticsearch.comwrote:

hey can you provide your mapping please and maybe the exception that is in
the log files?

simon

On Tuesday, April 9, 2013 2:56:28 PM UTC+2, Maaz Bin Tariq wrote:

Hi,

I am using elasticsearch.0.90.0.RC1, and I am unable to use
termstatsfacet and statistical-facet,

Do they require any specfic fields mappings?

Using statistical-facet
{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "campaign_id.id"
}
}
}
}

Using termstatsfacet
{
"query": {
"match_all" : { }
},
"facets": {
"campaign_stats": {
"terms_stats": {
"key_field": "campaign_id.id",
"value_field": "amount.ll"
}
}
}
}

Both gives the same exception
nested: ClassCastException[org.**elasticsearch.index.fielddata.**plain.PagedBytesIndexFieldData
cannot be cast to org.elasticsearch.index.**fielddata.**IndexNumericFieldData];
}]","status":500

What I need to do to make it work?

Thanks
-Maaz

--
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/K7Z_17U3im0/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.

In the last stacktrace you shared, you are using the "_id" field which is a
string and not an number. The stats facet only works for number based
fields (int, long, short etc). The error returned is't helpful and I will
make the error more descriptive.

I also tested your search request examples from your first email and it
those seem to work fine. Did you ran these search requests with the mapping
you send in your latest email?

On 10 April 2013 06:53, Maaz Bin Tariq maaz786@gmail.com wrote:

Mappings

{
"pledge": {
"properties": {
"amount": {
"properties": {
"ll": {
"type": "long"
}
}
},
"campaign_id": {
"properties": {
"id": {
"type": "long"
}
}
},
"user": {
"properties": {
"id": {
"type": "string"
}
}
}
}
}
}
*
*
Exception in log files
Parse Failure [Failed to parse source [{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "_id"
}
}
}
}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:566)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:481)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:466)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:236)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException:
org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be
cast to org.elasticsearch.index.fielddata.IndexNumericFieldData
at
org.elasticsearch.search.facet.statistical.StatisticalFacetParser.parse(StatisticalFacetParser.java:119)
at
org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:554)
... 11 more

On Tue, Apr 9, 2013 at 6:36 PM, simonw simon.willnauer@elasticsearch.comwrote:

hey can you provide your mapping please and maybe the exception that is
in the log files?

simon

On Tuesday, April 9, 2013 2:56:28 PM UTC+2, Maaz Bin Tariq wrote:

Hi,

I am using elasticsearch.0.90.0.RC1, and I am unable to use
termstatsfacet and statistical-facet,

Do they require any specfic fields mappings?

Using statistical-facet
{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "campaign_id.id"
}
}
}
}

Using termstatsfacet
{
"query": {
"match_all" : { }
},
"facets": {
"campaign_stats": {
"terms_stats": {
"key_field": "campaign_id.id",
"value_field": "amount.ll"
}
}
}
}

Both gives the same exception
nested: ClassCastException[org.**elasticsearch.index.fielddata.**plain.PagedBytesIndexFieldData
cannot be cast to org.elasticsearch.index.**fielddata.**IndexNumericFieldData];
}]","status":500

What I need to do to make it work?

Thanks
-Maaz

--
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/K7Z_17U3im0/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.

For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.

--
Met vriendelijke groet,

Martijn van Groningen

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Yup, I also try to use _id field , other facets error are below, I use the
same mappings,
I have now moved to 0.90.0.RC2 the problem seems to go away.

Other Exceptions are
Parse Failure [Failed to parse source [{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "campaign_id.id"
}
}
}
}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:566)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:481)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:466)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:236)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException:
org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be
cast to org.elasticsearch.index.fielddata.IndexNumericFieldData
at
org.elasticsearch.search.facet.statistical.StatisticalFacetParser.parse(StatisticalFacetParser.java:119)
at
org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:554)
... 11 more


Parse Failure [Failed to parse source [{
"query": {
"match_all" : { }
},
"facets": {
"campaign_stats": {
"terms_stats": {
"key_field": "campaign_id.id",
"value_field": "amount.ll"
}
}
}
}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:566)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:481)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:466)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:236)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException:
org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be
cast to org.elasticsearch.index.fielddata.IndexNumericFieldData
at
org.elasticsearch.search.facet.termsstats.TermsStatsFacetParser.parse(TermsStatsFacetParser.java:124)
at
org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:554)
... 11 more

On Wed, Apr 10, 2013 at 1:56 PM, Martijn v Groningen <
martijn.v.groningen@gmail.com> wrote:

In the last stacktrace you shared, you are using the "_id" field which is
a string and not an number. The stats facet only works for number based
fields (int, long, short etc). The error returned is't helpful and I will
make the error more descriptive.

I also tested your search request examples from your first email and it
those seem to work fine. Did you ran these search requests with the mapping
you send in your latest email?

On 10 April 2013 06:53, Maaz Bin Tariq maaz786@gmail.com wrote:

Mappings

{
"pledge": {
"properties": {
"amount": {
"properties": {
"ll": {
"type": "long"
}
}
},
"campaign_id": {
"properties": {
"id": {
"type": "long"
}
}
},
"user": {
"properties": {
"id": {
"type": "string"
}
}
}
}
}
}
*
*
Exception in log files
Parse Failure [Failed to parse source [{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "_id"
}
}
}
}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:566)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:481)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:466)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:236)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException:
org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData cannot be
cast to org.elasticsearch.index.fielddata.IndexNumericFieldData
at
org.elasticsearch.search.facet.statistical.StatisticalFacetParser.parse(StatisticalFacetParser.java:119)
at
org.elasticsearch.search.facet.FacetParseElement.parse(FacetParseElement.java:92)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:554)
... 11 more

On Tue, Apr 9, 2013 at 6:36 PM, simonw <simon.willnauer@elasticsearch.com

wrote:

hey can you provide your mapping please and maybe the exception that is
in the log files?

simon

On Tuesday, April 9, 2013 2:56:28 PM UTC+2, Maaz Bin Tariq wrote:

Hi,

I am using elasticsearch.0.90.0.RC1, and I am unable to use
termstatsfacet and statistical-facet,

Do they require any specfic fields mappings?

Using statistical-facet
{
"query": {
"match_all": {}
},
"facets": {
"campaign_stats": {
"statistical": {
"field": "campaign_id.id"
}
}
}
}

Using termstatsfacet
{
"query": {
"match_all" : { }
},
"facets": {
"campaign_stats": {
"terms_stats": {
"key_field": "campaign_id.id",
"value_field": "amount.ll"
}
}
}
}

Both gives the same exception
nested: ClassCastException[org.**elasticsearch.index.fielddata.**plain.PagedBytesIndexFieldData
cannot be cast to org.elasticsearch.index.**fielddata.**IndexNumericFieldData];
}]","status":500

What I need to do to make it work?

Thanks
-Maaz

--
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/K7Z_17U3im0/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.

For more options, visit 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.

For more options, visit https://groups.google.com/groups/opt_out.

--
Met vriendelijke groet,

Martijn van Groningen

--
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/K7Z_17U3im0/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.