title: Elasticseach not using synonyms from synonym file
body: <p>I am new to elasticsearch so before downvoting or marking as duplicate, please read the question first.</p>
  
  <p>I am testing synonyms in elasticsearch (v 2.4.6) which I have installed on Ubuntu 16.04. I am giving synonyms through a file named <strong>synonym.txt</strong> which I have placed in <strong>config</strong> directory. I have created an index <strong>synonym_test</strong> as follows-</p>
  
  <pre><code>curl -XPOST localhost:9200/synonym_test/ -d '{
    "settings": {
      "analysis": {
        "analyzer": {
          "my_synonyms": {
            "tokenizer": "whitespace",
              "filter": ["lowercase","my_synonym_filter"] 
              }
           },
        "filter": {
          "my_synonym_filter": {
            "type": "synonym", 
              "ignore_case": true,
                "synonyms_path" : "synonym.txt"
                }
            }
        }
     }
  }'
  </code></pre>
  
  <p>The index contains two fields- <strong>id</strong> and <strong>some_text</strong>. I configure the field <strong>some_text</strong> with the custom analyzer as follows-</p>
  
  <pre><code>curl -XPUT localhost:9200/synonym_test/rulers/_mapping -d '{
    "properties": {
      "id": {
        "type": "double"
        },
      "some_text": {
        "type": "string",
            "search_analyzer": "my_synonyms"       
            }
        }
   }'
  </code></pre>
  
  <p>Then I have inserted some data as -</p>
  
  <pre><code>curl -XPUT localhost:9200/synonym_test/external/5 -d '{
    "id" : "5",
    "some_text":"apple is a fruit"
  }'
  curl -XPUT localhost:9200/synonym_test/external/7 -d '{
    "id" : "7",
    "some_text":"english is spoken in england"
  }'
  curl -XPUT localhost:9200/synonym_test/external/8 -d '{
    "id" : "8",
    "some_text":"Scotland Yard is a popular game."
  }'
  curl -XPUT localhost:9200/synonym_test/external/9 -d '{
    "id" : "9",
    "some_text":"bananas contain potassium"
  }'
  </code></pre>
  
  <p>The synonym.txt file contains following-</p>
  
  <pre><code>"britain,england,scotland"
  "fruit,bananas"
  </code></pre>
  
  <p>After doing all this, when I run the query for term <strong>fruit</strong> (which should also return the text containing bananas as they are synonyms in file), I get the text containing fruit only.</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "took":117,
     "timed_out":false,
     "_shards":{  
        "total":5,
        "successful":5,
        "failed":0
     },
     "hits":{  
        "total":1,
        "max_score":0.8465736,
        "hits":[  
           {  
              "_index":"synonym_test",
              "_type":"external",
              "_id":"5",
              "_score":0.8465736,
              "_source":{  
                 "id":"5",
                 "some_text":"apple is a fruit"
              }
           }
        ]
     }
  }
  </code></pre>
  
  <p>I have also tried the following links, but none seem to have helped me -
  <a href="https://stackoverflow.com/questions/39148225/synonym-analyzer-not-working">Synonym analyzer not working</a> ,
  <a href="https://stackoverflow.com/questions/29354312/elasticsearch-synonym-analyzer-not-working">Elasticsearch synonym analyzer not working</a> , <a href="https://stackoverflow.com/questions/42071623/how-to-apply-synonyms-at-query-time-instead-of-index-time-in-elasticsearch">How to apply synonyms at query time instead of index time in Elasticsearch</a> , <a href="https://stackoverflow.com/questions/18405779/how-to-configure-the-synonyms-path-in-elasticsearch">how to configure the synonyms_path in elasticsearch</a> and many other links.</p>
  
  <p>So, can anyone please tell me if I am doing anything wrong? Is there anything wrong with the settings or synonym file? I want the synonyms to work <strong>(query time)</strong> so that when I search for a term, I get all documents related to that term.</p>