Return distinct tags

Hi guys,
I have document of following format:
{
_id :"1",
tags:["guava","apple","mango", "banana", "gulmohar"]
}

{
_id:"2",
tags: ["orange","guava", "mango shakes", "apple pie", "grammar"]
}

{

_id:"3",
tags: ["guava","apple","grapes", "water",
"grammar","gulmohar","water-melon", "green"]
}

Now, I wanted to show tags suggestion to user:
For example: Whenever user types, 'g':
"guava", "gulmohar", "grammar", "grapes" and "green" should be returned as
a result.
ie. the query should returns distinct tags with prefix g*.

Here is my mapping:
..............................
"properties":{
"tags": {
"type": "string",
"include_in_all": false,
"term_vector": "with_positions_offsets"
}
}
............................
I tried everywhere, browse whole documentations, but I didn't find any
clue, much to my dismay.
I tried aggregation, but aggregation returns the distinct count for whole
words, not for word starting with 'g'.
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"query_string": {
"allow_leading_wildcard": false,
"fields": [
"tags"
],
"query": "Pizza*",
"fuzziness":0
}
}
]
}
},
"filter": {
//some condition on other field...
}

}

},
"aggs": {
"distinct_tags": {
"terms": {
"field": "tags",
"size": 10
}
}
},

result of above: guava(3), apple(2), mango(1)

Can someone please suggest me the correct way to fetch all the distinct
tags with prefix input_prefix*?

Thanks

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d81ee6c5-0021-4085-9544-508881900c22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.