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:
- Make separate document with name field "NYC" and allow search over that, or
- 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 ):
- In the first approach, updating other fields (other than short hands) will be a pain
- 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.