<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Eduardo Neves on Medium]]></title>
        <description><![CDATA[Stories by Eduardo Neves on Medium]]></description>
        <link>https://medium.com/@_eth0_?source=rss-9b8dece1e12a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Mhl4PqpcF43RK0f6.</url>
            <title>Stories by Eduardo Neves on Medium</title>
            <link>https://medium.com/@_eth0_?source=rss-9b8dece1e12a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 17:26:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@_eth0_/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Magic with elasticsearch using synonyms]]></title>
            <link>https://medium.com/@_eth0_/magic-with-elasticsearch-using-synonyms-c89df92747bf?source=rss-9b8dece1e12a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c89df92747bf</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Eduardo Neves]]></dc:creator>
            <pubDate>Thu, 20 Apr 2017 18:35:11 GMT</pubDate>
            <atom:updated>2017-04-20T18:35:11.156Z</atom:updated>
            <content:encoded><![CDATA[<p>Using synonyms is a very powerful way to cheaply increase the flexibility of your search capabilities. With a minimal configuration you can associate “Food” and “Snack” to “Restaurant”.</p><p>Synonyms appear to be quite straightforward, but we need to get a special attention for this because this is where things start to go wrong.</p><h3>How it works?</h3><p>To setup a synonyms we have to do two little things:</p><ul><li>Create a synonym analyzer</li><li>Create the index with setting and mappings to support synonyms.</li></ul><p>First we need to create a synonym file, by default the path is the ElasticSearch config directory</p><blockquote>sample_index_synonym.txt<br>Restaurant =&gt; food,snack</blockquote><p>Now we create a synonym analyzer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*2ElCNjshoK7pxNWUFfeuZg.png" /></figure><p>Now we verify the tokens emitted by the analyzer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*D1SXzPGSQ7p2krPPsNqGMw.png" /></figure><p>When we search the text ‘restaurant’, elasticsearch will perform a query using the synonym analyzer and when it search restaurant, it search food and snack too, lets see it in practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*rIhsPkQEiQbJn3M9AoUfpw.png" /></figure><p>Now we have some data to demonstrate how this query work!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*hjmdwrFaJ5naEDKuA5We2A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c89df92747bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>