How can I apply elasticsearch to detect specific word such as cityname from query string

I try to detect citiy name from query search by using elasticsearch, don't know where to start

"Detecting" is not really what elasticsearch is doing.
Can you tell more about what is exactly the use case?

What do you index?
What do you search for?