title: How to filter with multiple fields and values in elasticsearch?
body: <p>I've been reading through the docs and been trying to achieve a solution to filter results through multiple fields and columns, however I keep getting errors; <em>malformed query</em>.</p>
  
  <p>I want to filter the result with exact equal values, such as the following:</p>
  
  <pre><code>is_active: true
  category_id: [1,2,3,4]
  brand: "addidas"
  gender: "male"
  </code></pre>
  
  <p>To make it more clear what I intend to do, this is how I'd like it to run if it would be written in SQL:</p>
  
  <pre><code>SELECT .... WHERE 
  is_active= 1 AND category_id IN(1,2,3,4) 
  AND brand='addidas' AND gender='male'
  </code></pre>
  
  <p>My query in DSL goes as following:</p>
  
  <pre><code>{
      "body": {
          "query": {
              "nested": {
                  "query": {
                      "bool": {
                          "must": {
                              "terms": {
                                  "category_id": [
                                      1,
                                      2,
                                      3
                                  ]
                              },
                              "term": {
                                  "is_active": true
                              },
                              "term": {
                                  "brand": "addidas"
                              }
                          }
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p><strong>How do I filter multiple fileds and values as described, in elasticsearch?</strong></p>
  
  <p><em>If you need extra information from me that is required to answer the question, leave a comment.</em> If you add a link to the docs, please also provide an example (with query dsl) of how my current, or similar situations should be solved.</p>