Auto suggest on a static list of records

Hi ,

I have a simple use case of auto suggest and i am trying to build that
using ES.

Basically i have the following mapping

"Amazon INC" -> "Amazon" , "AMZN" , "12345" , "RES33"
"Amona INC" -> "Amona" , "AMON" , "2345" , "RESss"
"Yahoo INC" -> "Yahoo" , "YHOO" , "3456" , "OKI876"
"Google INC" -> "Google" , "GOOG" , "3445" , "POO099"

"America" -> "America" , "US"
"India" -> "India"
"UK" -> "Britain" , "UK"

So basically i have the above data. I need to map all the keywords on the
left of the mapping to the right.

So , if i search for

query - AM

Result should be

"Region" : [ "America"],
"Companies" : [ "Amazon INC" , "Amona INC"]

One main point to be noted is that

  • For any search , there should be maximum of 10 results from each type
    (Like region or companies) and NOT total 10.

How can i achieve this using ES.



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
For more options, visit