Here is my mapping for a field:
"likes": { "type": "text", "fields": { "length": { "type": "token_count", "analyzer": "email_analyzer" } } },
likes is an array of email ids, i.e
likes : [ "a@b.com", "b@c.com"]
While searching, i would like to retrieve the "likes.length" field instead of entire likes as likes.length would store size of the array.
I tried with _source : [ "likes.length" ] , but its not showing up.
thanks,
Raja