Receiving 'ReduceSearchPhaseException' -- kills the search

Hiya,

I get this message when searching across indexes where the item type
does not exist at all. If I run my query below just on the index where
this object does for sure exist then I do not get this error.

The issue might be also that I would like elasticsearch to silently
fail when the facet cannot be cast on an object.

I notice that even if data exists on one of the three indexes, the
search still fails.

I am open to further discussion.

Thanks and have a warm winter,
Bryan Green

Specifically, it is the long UPCID field that is causing this issue.

[22-Dec-2011 17:33:41] Elasticsearch error:
ReduceSearchPhaseException[Failed to execute phase [fetch],
[reduce] ]; nested:
ClassCastException[org.elasticsearch.search.facet.terms.strings.InternalStringTermsFacet
cannot be cast to
org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet];
url:system,library,kk/borrowed_item/_search curl_results:
{"error":"ReduceSearchPhaseException[Failed to execute phase [fetch],
[reduce] ]; nested:
ClassCastException[org.elasticsearch.search.facet.terms.strings.InternalStringTermsFacet
cannot be cast to
org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet];
","status":500}

{
"from": 0,
"size": 0,
"facets": {
"collection": {
"terms": {
"field": "collection",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"_type": {
"terms": {
"field": "_type",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"statustype": {
"terms": {
"field": "instances.statustype",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"region": {
"terms": {
"field": "region",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"subject": {
"terms": {
"field": "subject",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"user_id": {
"terms": {
"field": "user_id",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"upcid": {
"terms": {
"field": "upcid",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"title": {
"terms": {
"field": "title",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"duration": {
"terms": {
"field": "duration",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"check_out_date": {
"terms": {
"field": "check_out_date",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"renew_date": {
"terms": {
"field": "renew_date",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"due_date": {
"terms": {
"field": "due_date",
"size": "100",
"order": "count"
},
"facet_filter": []
},
"check_in_date": {
"terms": {
"field": "check_in_date",
"size": "100",
"order": "count"
},
"facet_filter": []
}
}
}

When you facet on a field across index types, they need to be of the same
field type (string, long). You can name the field differently.

On Fri, Dec 23, 2011 at 1:43 AM, Bryan Green bryogreen@gmail.com wrote:

Hiya,

I get this message when searching across indexes where the item type
does not exist at all. If I run my query below just on the index where
this object does for sure exist then I do not get this error.

The issue might be also that I would like elasticsearch to silently
fail when the facet cannot be cast on an object.

I notice that even if data exists on one of the three indexes, the
search still fails.

I am open to further discussion.

Thanks and have a warm winter,
Bryan Green

Specifically, it is the long UPCID field that is causing this issue.

[22-Dec-2011 17:33:41] Elasticsearch error:
ReduceSearchPhaseException[Failed to execute phase [fetch],
[reduce] ]; nested:

ClassCastException[org.elasticsearch.search.facet.terms.strings.InternalStringTermsFacet
cannot be cast to
org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet];
url:system,library,kk/borrowed_item/_search curl_results:
{"error":"ReduceSearchPhaseException[Failed to execute phase [fetch],
[reduce] ]; nested:

ClassCastException[org.elasticsearch.search.facet.terms.strings.InternalStringTermsFacet
cannot be cast to
org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet];
","status":500}

{
"from": 0,
"size": 0,
"facets": {
"collection": {
"terms": {
"field": "collection",
"size": "100",
"order": "count"
},
"facet_filter":
},
"_type": {
"terms": {
"field": "_type",
"size": "100",
"order": "count"
},
"facet_filter":
},
"statustype": {
"terms": {
"field": "instances.statustype",
"size": "100",
"order": "count"
},
"facet_filter":
},
"region": {
"terms": {
"field": "region",
"size": "100",
"order": "count"
},
"facet_filter":
},
"subject": {
"terms": {
"field": "subject",
"size": "100",
"order": "count"
},
"facet_filter":
},
"user_id": {
"terms": {
"field": "user_id",
"size": "100",
"order": "count"
},
"facet_filter":
},
"upcid": {
"terms": {
"field": "upcid",
"size": "100",
"order": "count"
},
"facet_filter":
},
"title": {
"terms": {
"field": "title",
"size": "100",
"order": "count"
},
"facet_filter":
},
"duration": {
"terms": {
"field": "duration",
"size": "100",
"order": "count"
},
"facet_filter":
},
"check_out_date": {
"terms": {
"field": "check_out_date",
"size": "100",
"order": "count"
},
"facet_filter":
},
"renew_date": {
"terms": {
"field": "renew_date",
"size": "100",
"order": "count"
},
"facet_filter":
},
"due_date": {
"terms": {
"field": "due_date",
"size": "100",
"order": "count"
},
"facet_filter":
},
"check_in_date": {
"terms": {
"field": "check_in_date",
"size": "100",
"order": "count"
},
"facet_filter":
}
}
}