Skip to content

Instantly share code, notes, and snippets.

@thongnguyenhuu
thongnguyenhuu / gist:f33e0e02ed7ce9b26a92
Created October 12, 2015 02:06 — forked from clintongormley/gist:4095280
Using synonyms in Elasticsearch

We create an index with:

  • two filters: synonyms_expand and synonyms_contract
  • two analyzers: synonyms_expand and synonyms_contract
  • three text fields:
    • text_1 uses the synonyms_expand analyzer at index and search time
    • text_2 uses the synonyms_expand analyzer at index time, but the standard analyzer at search time
    • text_3 uses the synonyms_contract analyzer at index and search time

.