I am trying to make a synonym for a category so that voucher and gift card mean the same thing in index time. So when users type in voucher or gift card, elasticsearch returns the same results.
For some reasons, the settings and mappings I am using don't work at all.
As you can see, if your document contains "voucher", it will be indexed with "voucher" and "gift card", as you defined in your mapping, so for me it's all good.
No the query looks fine, so you need to debug this, and try to understand the reason why the second query doesnt return anything.
Add the explain parameter to understand how the score is calculated, and search only on the category field to be sure, the results of the first query are coming from this field.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.