title: Elasticsearch must_not not working with filter clause
body: <p>I am working on medical project, where I have multiple questions along with the topics attached to them. The problem is that the following code works fine but it does not consider the 'must_not' filter, whereas it works fine with 'must' clause. Help me out with this.</p>
  
  <pre><code>GET stopdata/_search
  {
    "query": {
      "function_score": {
        "query": {
          "filtered": {
            "query": {
              "match": {
                "question": "Hello Dr. Iam suffering from fever with cough nd cold since 3 days"
              }
            }
          }
        },
        "filter": {
          "bool": {
            "must": [
              {
                "terms": {
                  "topics": [
                    "fever",
                    "cough"
                  ]
                }
              }
            ],
            "must_not": [
              {
                "terms": {
                  "topics": [
                    "children",
                    "child",
                    "childrens health"
                  ]
                }
              }
            ]
          }
        },
        "random_score": {}
      }
    },
    "highlight": {
      "fields": {
        "keyword": {}
      }
    }
  }
  </code></pre>
  
  <p>Also, I need to convert the code to Java, which I am trying but stuck with following code.</p>
  
  <pre><code>Set&lt;String&gt; mustNot = new HashSet&lt;String&gt;();
  mustNot.add("child");
  mustNot.add("children");
  mustNot.add("childrens health");
  
  Set&lt;String&gt; must = new HashSet&lt;String&gt;();
  must.add("fever");
  must.add("cough");
  
  FunctionScoreQueryBuilder fsqb = new FunctionScoreQueryBuilder(QueryBuilders.matchQuery("question", "Hello Dr. Iam suffering from fever with cough nd cold since 3 days"));
  fsqb.add(ScoreFunctionBuilders.randomFunction((new Date()).getTime()));
  
  BoolQueryBuilder bqb = boolQuery()
          .mustNot(termsQuery("topics", mustNot));
  
  SearchResponse response1 = client.prepareSearch("stopdata")
          .setQuery(fsqb)
          .execute()
          .actionGet();
  
  System.out.println(response1.getHits().getTotalHits());
  </code></pre>
  
  <p>The mapping of the 'stopdata' index is as follow</p>
  
  <pre><code>{
     "stopdata": {
        "mappings": {
           "questions": {
              "properties": {
                 "answers": {
                    "type": "string"
                 },
                 "id": {
                    "type": "long"
                 },
                 "question": {
                    "type": "string",
                    "analyzer": "my_english"
                 },
                 "relevantQuestions": {
                    "type": "long"
                 },
                 "topics": {
                    "type": "string"
                 }
              }
           }
        }
     }
  }
  </code></pre>
  
  <p>Adding the sample data for the above index</p>
  
  <pre><code>"question": "My son of age 8 months is suffering from cough and cold and fever. What treatment I have to follow?"
  "topics": [
    "Cough",
    "Fever",
    "Hydration",
    "Nutrition",
    "Tens",
    "Childrens health"
  ]
  
  "question": "Hi.My daughter, 4 years old , has on and of fever  with severe coughing and colds for 3 days now.She vomited as well last night.Do you think it's viral?"
  "topics": [
    "Vomiting",
    "Flu",
    "Cough",
    "Fever",
    "Pneumonia",
    "Meningitis",
    "Tamiflu",
    "Incision",
    "Childrens health",
    "Oseltamivir"
  ]
  
  "question": "If you have a fever of 101 with chills and sweats for 2 day with a slight cough, should you go to the drs or let is wear off?"
  "topics": [
    "Cough",
    "Fever"
  ]
  </code></pre>