title: Use synonyms in elasticsearch
body: <p>I am trying to implement synonyms file in my search implementation. I found many documents as guidelines for implementing that but could not end up with a working solution.</p>
  
  <p>First, I have added the analyzer as follows:</p>
  
  <pre><code>PUT /products/_settings
  {
      "settings": {
          "index" : {
              "analysis" : {
                  "analyzer" : {
                      "synonym" : {
                          "tokenizer" : "whitespace",
                          "filter" : ["synonym"]
                      }
                  },
                  "filter" : {
                      "synonym" : {
                          "type" : "synonym",
                          "synonyms_path" : "analysis/synonym.txt"
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Then I was trying to use this synonym analyzer like the following:</p>
  
  <pre><code>GET products/_search
  {
      "query": {
          "multi_match": {
              "query": "television",
              "fields": ["prd_name","brand_name", "prd_sdescription"],
              "analyzer": "synonym"
          }
      }
  }
  </code></pre>
  
  <p>I have the synonym as solr format like:</p>
  
  <pre><code>GB,gib,gigabyte,gigabytes
  MB,mib,megabyte,megabytes
  Television, Televisions, TV, TVs
  </code></pre>
  
  <p>But the search gets nothing for television while I have records for TV.</p>
  
  <p>I also tried to search single field (prd_name) with synonym match, for that I need to change the but getting error when I want to change the mapping of the prd_name field.</p>
  
  <pre><code>"type": "illegal_argument_exception",
  "reason": "Mapper for [prd_name] conflicts with existing mapping in other types:\n[mapper [prd_name] has different [analyzer]]"
  </code></pre>
  
  <p>The current mapping of prd_name is:</p>
  
  <pre><code>"prd_name": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
  }
  </code></pre>
  
  <p>If someone could give me step by step solution that would be great for me.</p>
  
  <pre><code>Elasticsearch version: 6.4.1
  </code></pre>