erikthered
(Erik Redding)
October 24, 2015, 3:24am
1
Continuing the discussion from IndexOutOfBoundsException when specifying type :
I have a query that is failing when I specify a type (e.g. localhost:9200/development/entity_analytics
) but not when I just search on localhost:9200/development
I get this error:
Query Failed [Failed to execute main query]]; nested: GroovyScriptExecutionException[ElasticsearchParseException[failed to parse / load source]; nested: IndexOutOfBoundsException[docID must be >= 0 and < maxDoc=80 (got docID=6284)]; ]; "
This only happens when I have two scripts in my query, and aggregation and TF calculation, like so:
{
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"has_parent": {
"type": "profile_entity_relationship",
"filter": {
"bool": {
"must": [
{
"term": {
"profile_id": 12
}
},
{
"bool": {
"must": [
{
"script": {
"script": "(_index['title'][term].tf() + _index['content'][term].tf()) >= frequency",
"params": {
"term": "facebook",
"frequency": 1
}
}
}
]
}
}
]
}
}
}
}
]
}
}
}
},
"aggs": {
"revenue": {
"sum": {
"script": "Map map = new HashMap(); for(field in ['total_goals','total_events']){if(_source.containsKey(field)){for(e in _source[field]){ map.put(field+e.name, e.value.intValue());}}};(map.containsKey('total_eventsevent1') ? map.get('total_eventsevent1') * 500 : 0) "
}
}
},
"size": 0
}