title: Matching null in should query in Elasticsearch 2.3.0
body: <p>I have a field <code>gender</code> which can have three values:</p>
  
  <ul>
  <li>MALE</li>
  <li>FEMALE</li>
  <li>null</li>
  </ul>
  
  <p>The mapping of <code>gender</code> is:</p>
  
  <pre><code>"gender": {
      "type": "string",
      "index": "not_analyzed"
  }
  </code></pre>
  
  <p>To match <code>null</code> I am following <a href="https://www.elastic.co/guide/en/elasticsearch/reference/2.3/query-dsl-exists-query.html#_literal_missing_literal_query" rel="nofollow">this</a>.</p>
  
  <p>I used this query to get the documents with <code>gender</code> as <code>null</code>:</p>
  
  <pre><code>{
      "query": {
          "bool": {
              "must_not": {
                  "exists": {
                      "field": "gender"
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I want to build a <code>should</code> query so that the search results could return any documents having the <code>gender</code> field:</p>
  
  <pre><code>{
    "query": {
      "bool": {
        "should": {
          "bool": {
            "should": [
              {
                "match": {
                  "gender": {
                    "query": "MALE",
                    "type": "boolean"
                  }
                }
              },
              {
                "match": {
                  "gender": {
                    "query": "FEMALE",
                    "type": "boolean"
                  }
                }
              }
            ],
            "must_not": {
              "exists": {
                "field": "gender"
              }
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>The query above gives me 0 hits. How should I construct the right query for this?</p>