title: Elasticsearch - Same search result for "and" and "ampersand"(&) in query
body: <p>"<strong>Designing an index in Elasticsearch so that "&amp;" and "and" in query returns same result</strong>"</p>
  
  <p>How can we make Elasticsearch return same results whether the search was made with "<strong>and</strong>" as the query string or ampersand "<strong>&amp;</strong>". </p>
  
  <p>For example there's a query to look for all movie titles containing "<strong>and / &amp;</strong>" in their name.</p>
  
  <ol>
  <li>Mr. &amp; Mrs. Smith</li>
  <li>Jack and Jill</li>
  <li>Abc and Def &amp; ghi</li>
  <li>Dummy Name</li>
  </ol>
  
  <p>So in this case it shouldn't matter if the search is done with "and" or "&amp;" in query should return 1,2,3.</p>
  
  <p><strong><em>Dump from my Kibana Dev Tool</em></strong> </p>
  
  <p>PUT test_index
  {
    "settings": {"number_of_replicas": 0,
      "number_of_shards": 1
    },
    "mappings": {
      "doc":
      {
        "properties": {
          "movie_name":{"type":"text"}
        }
      }
    }
  }</p>
  
  <p>PUT /test_index/doc/1
  {
    "movie_name":"Mr. &amp; Mrs. Smith"
  }</p>
  
  <p>PUT /test_index/doc/2
  {
    "movie_name":"Jack and Jill"
  }</p>
  
  <p>PUT /test_index/doc/3
  {
    "movie_name":"Abc and Def &amp; ghi"
  }</p>
  
  <p>PUT /test_index/doc/4
  {
    "movie_name":"Dummy Name"
  }</p>
  
  <p><strong>Both the queries below should return the same result</strong> </p>
  
  <ol>
  <li><p>GET test_index/_search
  {
  "size": 20,
  "query": {
  "match": {
    "movie_name": "&amp;"
  }
  }
  }</p></li>
  <li><p>GET test_index/_search
  {
  "size": 20,
  "query": {
  "match": {
    "movie_name": "and"
  }
  }
  }</p></li>
  </ol>