title: Elasticsearch Became case sensitive after add synonym analyzer
body: <p>After I added synonym analyzer to my_index, the index became case-sensitive</p>
  <p>I have one property called <code>nationality</code> that has <code>synonym analyzer</code>. But it seems that this property become <code>case sensitive</code> because of the synonym analyzer.</p>
  <p>Here is my <code>/my_index/_mappings</code></p>
  <pre><code>{
    &quot;my_index&quot;: {
      &quot;mappings&quot;: {
        &quot;items&quot;: {
          &quot;properties&quot;: {
            .
            .
            .
            &quot;nationality&quot;: {
              &quot;type&quot;: &quot;text&quot;,
              &quot;fields&quot;: {
                &quot;keyword&quot;: {
                  &quot;type&quot;: &quot;keyword&quot;,
                  &quot;ignore_above&quot;: 256
                }
              },
              &quot;analyzer&quot;: &quot;synonym&quot;
            },
            .
            .
            .
          }
        }
      }
    }
  }
  </code></pre>
  <p>Inside the index, i have word <code>India COUNTRY</code>. When I try to search <code>India nation</code> using the command below, I will get the result.</p>
  <pre><code>POST /my_index/_search
  {
    &quot;query&quot;: {
      &quot;match&quot;: {
        &quot;nationality&quot;: &quot;India nation&quot;
      }
    }
  }
  </code></pre>
  <p>But, when I search for <code>india</code> (notice the letter <code>i</code> is lowercase), I will get nothing.
  My assumption is, this happend because i put <code>uppercase</code> filter before the <code>synonym</code>. I did this because the synonyms are uppercased. So the query <code>India</code> will be <code>INDIA</code> after pass through this filter.</p>
  <p>Here is my <code>/my_index/_settings</code></p>
  <pre><code>{
    &quot;my_index&quot;: {
      &quot;settings&quot;: {
        &quot;index&quot;: {
          &quot;number_of_shards&quot;: &quot;1&quot;,
          &quot;provided_name&quot;: &quot;my_index&quot;,
          &quot;similarity&quot;: {
            &quot;default&quot;: {
              &quot;type&quot;: &quot;BM25&quot;,
              &quot;b&quot;: &quot;0.9&quot;,
              &quot;k1&quot;: &quot;1.8&quot;
            }
          },
          &quot;creation_date&quot;: &quot;1647924292297&quot;,
          &quot;analysis&quot;: {
            &quot;filter&quot;: {
              &quot;synonym&quot;: {
                &quot;type&quot;: &quot;synonym&quot;,
                &quot;lenient&quot;: &quot;true&quot;,
                &quot;synonyms&quot;: [
                  &quot;NATION, COUNTRY, FLAG&quot;
                ]
              }
            },
            &quot;analyzer&quot;: {
              &quot;synonym&quot;: {
                &quot;filter&quot;: [
                  &quot;uppercase&quot;,
                  &quot;synonym&quot;
                ],
                &quot;tokenizer&quot;: &quot;whitespace&quot;
              }
            }
          },
          &quot;number_of_replicas&quot;: &quot;1&quot;,
          &quot;version&quot;: {
            &quot;created&quot;: &quot;6080099&quot;
          }
        }
      }
    }
  }
  </code></pre>
  <p>Is there a way so I can make this property still case-insensitive. All the solution i've found only shows that I should only either set all the text inside <code>nationality</code> to be lowercase or uppercase. But how if I have uppercase &amp; lowercase letters inside the index?</p>