title: Elasticsearch synonym analyzer not working
body: <p>EDIT: To add on to this, the synonyms seem to be working with basic querystring queries. </p>
  
  <pre><code>"query_string" : {
      "default_field" : "location.region.name.raw",
      "query" : "nh"
  }
  </code></pre>
  
  <p>This returns all of the results for New Hampshire, but a "match" query for "nh" returns no results. </p>
  
  <hr>
  
  <p>I'm trying to add synonyms to my location fields in my Elastic index, so that if I do a location search for "Mass," "Ma," or "Massachusetts" I'll get the same results each time. I added the synonyms filter to my settings and changed the mapping for locations. Here are my settings:</p>
  
  <pre><code>analysis":{
      "analyzer":{
          "synonyms":{
              "filter":[
                  "lowercase",
                  "synonym_filter"
              ],
          "tokenizer": "standard"
      }
  },
  "filter":{
      "synonym_filter":{
          "type": "synonym",
          "synonyms":[
              "United States,US,USA,USA=&gt;usa",
              "Alabama,Al,Ala,Ala",
              "Alaska,Ak,Alas,Alas",
              "Arizona,Az,Ariz",
              "Arkansas,Ar,Ark",
              "California,Ca,Calif,Cal",
              "Colorado,Co,Colo,Col",
              "Connecticut,Ct,Conn",
              "Deleware,De,Del",
              "District of Columbia,Dc,Wash Dc,Washington Dc=&gt;Dc",
              "Florida,Fl,Fla,Flor",
              "Georgia,Ga",
              "Hawaii,Hi",
              "Idaho,Id,Ida",
              "Illinois,Il,Ill,Ills",
              "Indiana,In,Ind",
              "Iowa,Ia,Ioa",
              "Kansas,Kans,Kan,Ks",
              "Kentucky,Ky,Ken,Kent",
              "Louisiana,La",
              "Maine,Me",
              "Maryland,Md",
              "Massachusetts,Ma,Mass",
              "Michigan,Mi,Mich",
              "Minnesota,Mn,Minn",
              "Mississippi,Ms,Miss",
              "Missouri,Mo",
              "Montana,Mt,Mont",
              "Nebraska,Ne,Neb,Nebr",
              "Nevada,Nv,Nev",
              "New Hampshire,Nh=&gt;Nh",
              "New Jersey,Nj=&gt;Nj",
              "New Mexico,Nm,N Mex,New M=&gt;Nm",
              "New York,Ny=&gt;Ny",
              "North Carolina,Nc,N Car=&gt;Nc",
              "North Dakota,Nd,N Dak, NoDak=&gt;Nd",
              "Ohio,Oh,O",
              "Oklahoma,Ok,Okla",
              "Oregon,Or,Oreg,Ore",
              "Pennsylvania,Pa,Penn,Penna",
              "Rhode Island,Ri,Ri &amp; PP,R Isl=&gt;Ri",
              "South Carolina,Sc,S Car=&gt;Sc",
              "South Dakota,Sd,S Dak,SoDak=&gt;Sd",
              "Tennessee,Te,Tenn",
              "Texas,Tx,Tex",
              "Utah,Ut",
              "Vermont,Vt",
              "Virginia,Va,Virg",
              "Washington,Wa,Wash,Wn",
              "West Virginia,Wv,W Va, W Virg=&gt;Wv",
              "Wisconsin,Wi,Wis,Wisc",
              "Wyomin,Wi,Wyo"
          ]
      }
  }
  </code></pre>
  
  <p>And the mapping for the location.region field:</p>
  
  <pre><code>"region":{
      "properties":{
          "id":{"type": "long"},
          "name":{
              "type": "string",
              "analyzer": "synonyms",
              "fields":{"raw":{"type": "string", "index": "not_analyzed" }}
          }
      }
  }
  </code></pre>
  
  <p>But the synonyms analyzer doesn't seem to be doing anything. This query for example:</p>
  
  <pre><code>"match" : {
      "location.region.name" : {
          "query" : "Massachusetts",
          "type" : "phrase",
          "analyzer" : "synonyms"
      }
  }
  </code></pre>
  
  <p>This returns hundreds of results, but if I replace "Massachusetts" with "Ma" or "Mass" I get 0 results. Why isn't it working?</p>