Creating alias to enable short hand keyword search

G'Day everybody,

Stating the problem:
We have full names like say "New York City" in our ES cluster, but alot of our users are trying to search using the short hand notation like "NYC". How should I index my document for this? I can think about two approaches:

  1. Make separate document with name field "NYC" and allow search over that, or
  2. Have some kind of alias fields within the original document, which fulfills the goal.

The cons for each, (based on the updating document, as new short hands are found or something else changes ):

  1. In the first approach, updating other fields (other than short hands) will be a pain
  2. in the second field, it will be really easy to maintain it.

So, I want to go for the second approach but I'm not able to think of the best way do it.
Need help for the approach.
(Will just keeping an array of aliases work?)

Really appreciate all the help.
Thanks

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