Hi All,

I'm having trouble with a value_count aggregation that uses a script. For 
context I have an index of 100,000 dummy documents all with 1-word titles.

My query looks like:

{
"query": {
  "match_all": {}
},
"filter": {
  "match_all": {}
},
"aggs": {
 "category_tokens": {
   "value_count": {
     "script": "doc['title'].values.size() > 1"
   }
 }
}


But I get an error like: 'CompileException[[Error: No field found for 
[org.elasticsearch.index.fielddata.ScriptDocValues$Strings@1cdd34b3]'. 

If it helps my mapping looks like:

"title": {
  "type": "string"
}


What am I doing wrong here? Is it not possible to use a script like this? 

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/8ab1b50d-ae91-4a2f-b92e-cb5ebcf9ca02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to