Retrieve multifield data in search

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 : [ "", ""]

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.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.