title: Must Match two different terms
body: <p>I am looking to filter results where two sets of data match
  I get hits when I specify "should" but not "must"
  Here is my query works as expected with just the one "match" but if I add a second I get no hits yet there are definitely records in the index that have productSpecification.value of Brand and 3 Years</p>
  
  <pre><code>"query": {
  "bool": {
    "should": [
      {
        "multi_match": {
          "query": "control*",
          "fields": [
            "name^15",
            "description^5",
            "productCode"
          ]
        }
      }
    ]
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>"post_filter": {
  "nested": {
    "path": "productSpecification",
    "query": {
      "bool":{
          "must": [
              {
                  "match": {
                      "productSpecification.value":"3 years"
                  }
              },
              {
                  "match": {
                      "productSpecification.value":"Brand"
                  }
              }
          ]           
      }        
    }
    }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Just banging my head against the desk now trying different combinations of JSON trying to get this to return some values</p>
  
  <pre><code>{
  "myindex": {
      "mappings": {
          "product": {
              "properties": {
                  "description": {
                      "type": "text",
                      "fields": {
                          "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                          }
                      }
                  },
                  "dispatchTimeInDays": {
                      "type": "integer"
                  },
                  "height": {
                      "type": "integer"
                  },
                  "html": {
                      "type": "text",
                      "fields": {
                          "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                          }
                      }
                  },
                  "leadTimeInDays": {
                      "type": "integer"
                  },
                  "length": {
                      "type": "integer"
                  },
                  "limitedStock": {
                      "type": "boolean"
                  },
                  "name": {
                      "type": "text",
                      "fields": {
                          "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                          }
                      }
                  },
                  "notes": {
                      "type": "text",
                      "fields": {
                          "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                          }
                      }
                  },
                  "price": {
                      "type": "double"
                  },
                  "productBrandId": {
                      "type": "integer"
                  },
                  "productCategory": {
                      "properties": {
                          "code": {
                              "type": "text",
                              "fields": {
                                  "keyword": {
                                      "type": "keyword",
                                      "ignore_above": 256
                                  }
                              }
                          },
                          "fullPath": {
                              "type": "text",
                              "fields": {
                                  "keyword": {
                                      "type": "keyword",
                                      "ignore_above": 256
                                  }
                              }
                          },
                          "name": {
                              "type": "text",
                              "fields": {
                                  "keyword": {
                                      "type": "keyword",
                                      "ignore_above": 256
                                  }
                              }
                          },
                          "parentProductCategoryId": {
                              "type": "integer"
                          },
                          "productCategoryId": {
                              "type": "integer"
                          }
                      }
                  },
                  "productCategoryId": {
                      "type": "integer"
                  },
                  "productCode": {
                      "type": "text",
                      "fields": {
                          "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                          }
                      }
                  },
                  "productId": {
                      "type": "integer"
                  },
                  "productImage": {
                      "type": "text",
                      "fields": {
                          "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                          }
                      }
                  },
                  "productSpecification": {
                      "type": "nested",
                      "properties": {
                          "description": {
                              "type": "text",
                              "fields": {
                                  "keyword": {
                                      "type": "keyword",
                                      "ignore_above": 256
                                  }
                              }
                          },
                          "name": {
                              "type": "keyword"
                          },
                          "productId": {
                              "type": "long"
                          },
                          "productSpecificationId": {
                              "type": "long"
                          },
                          "specificationId": {
                              "type": "long"
                          },
                          "value": {
                              "type": "keyword"
                          }
                      }
                  },
                  "productTypeId": {
                      "type": "integer"
                  },
                  "reviewRating": {
                      "type": "double"
                  },
                  "reviewRatingCount": {
                      "type": "integer"
                  },
                  "sellingPriceGroupId": {
                      "type": "integer"
                  },
                  "stockAvailable": {
                      "type": "integer"
                  },
                  "taxRateId": {
                      "type": "integer"
                  },
                  "url": {
                      "type": "text",
                      "fields": {
                          "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                          }
                      }
                  },
                  "weightKg": {
                      "type": "double"
                  },
                  "width": {
                      "type": "integer"
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Here is an example of a product I would expect to be returned with this query it has a productSpecification.value of "3 years" AND a productSpecification.value of "Brand"</p>
  
  <pre><code>{
  "_index": "myindex",
  "_type": "product",
  "_id": "uQEDbGEBfHre1rYmtsWB",
  "_score": 141.5985,
  "_source": {
      "productId": 14587,
      "name": "Brand Wave Multi Channel Remote Control",
      "productCode": "111",
      "productCategoryId": 17,
      "length": 3,
      "height": 0,
      "productTypeId": 1,
      "url": "brand-wave-multi-channel-remote-control",
      "productBrandId": 3,
      "width": 0,
      "dispatchTimeInDays": 3,
      "leadTimeInDays": 3,
      "stockAvailable": 0,
      "weightKg": 0.001,
      "reviewRatingCount": 0,
      "limitedStock": false,
      "price": 63,
      "productImage": "Wave-Remote-Control.jpg",
      "productCategory": {
          "productCategoryId": 17,
          "name": "Accessories",
          "fullPath": "Accessories",
          "code": "00011"
      },
      "productSpecification": [{
              "productSpecificationId": 852888,
              "productId": 14587,
              "specificationId": 232,
              "name": "Brand",
              "description": "This is the product manufacturer",
              "value": "Brand"
          },
          {
              "productSpecificationId": 852889,
              "productId": 14587,
              "specificationId": 92,
              "name": "Type",
              "value": "Remote control"
          },
          {
              "productSpecificationId": 852891,
              "productId": 14587,
              "specificationId": 10,
              "name": "Guarantee",
              "value": "3 years"
          },
          {
              "productSpecificationId": 852892,
              "productId": 14587,
              "specificationId": 599,
              "name": "Power Voltage",
              "value": "1.5 V"
          },
          {
              "productSpecificationId": 852893,
              "productId": 14587,
              "specificationId": 29,
              "name": "Dimensions",
              "value": "157mm x 38mm x 19mm"
          },
          {
              "productSpecificationId": 852894,
              "productId": 14587,
              "specificationId": 602,
              "name": "Operation Range",
              "value": "Up to 40m"
          },
          {
              "productSpecificationId": 852895,
              "productId": 14587,
              "specificationId": 601,
              "name": "Power Supply",
              "value": "3V DC; 2 x AAA batteries"
          }
      ]
  }
  </code></pre>
  
  <p>}</p>
  
  <p>After numerous amends my query is now like</p>
  
  <pre><code>{
  "size": 100,
  
  
  "aggs": {
      "specifications": {
        "nested": {
          "path": "productSpecification"
        },
        "aggs": {
          "groups": {
            "terms": {
              "field": "productSpecification.name"
            },
            "aggs": {
              "attribute": {
                "terms": {
                  "field": "productSpecification.value"
                }
              }
            }
          }
        }
      },
      "price_range": {
        "range": {
          "field": "price",
          "ranges": [
            {
              "to": 50
            },
            {
              "from": 50,
              "to": 100
            },
            {
              "from": 100,
              "to": 150
            },
            {
              "from": 150,
              "to": 200
            },
            {
              "from": 200,
              "to": 250
            },
            {
              "from": 250
            }
          ]
        }
      }
    },
    "query": {
      "bool": {
        "should": [
          {
            "multi_match": {
              "query": "control*",
              "fields": [
                "name^15",
                "description^5",
                "productCode"
              ]
            }
          }
        ]
      }
    },
    "post_filter": {
      "query":{
      "nested": {
        "path": "productSpecification",
        "query": {
          "bool":{
              "should": [{
                  "bool": {
                      "must":[{
                          "term": {
                              "productSpecification.name.keyword": "Brand"
                          }
                      },
                      {
                          "term": {
                              "productSpecification.value": "Brand"
                          }
                      }
                      ]
                  }
              },
              {
                  "bool": {
                      "must": [
                          {
                              "term": {
                                  "productSpecification.name.keyword": "Guarantee"
                              }
                          },
                          {
                              "term": {
                                  "productSpecification.value": "3 years"
                              }
                          }
                      ]
                  }
              }
          ]
        }
        }
      }
    }
    }
    }
  </code></pre>