Script in value_count aggregation

I'm having an issue with an aggregate that looks like:

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

This aggregate always returns 100,000 (the number of dummy documents), but all of my titles are 1 word long. Is it possible to use size() in this way, or am I misunderstanding the docs?

For those who like context: I'm needing to distinguish between categorical 'string' fields and text 'string fields'. Maybe there is a better way to do this? I know this is possible via a filter but I'm already needing to do aggregations and want to keep the number of requests low.