title: Elasticsearch and C# - query to find exact matches over strings
body: <p>I need a way to search documents using a plain exact match over two or multiple fields which are of type "string" and "integer".</p>
  
  <p>I'd like to avoid standard query as I don't care about scoring or best match, just a yes/no outcome if both the fields match or not.</p>
  
  <p>I know I can do it using filters but I got only example queries using JSON format. I'd like to do such search in a C# environment.</p>
  
  <p>this is my mapping:</p>
  
  <pre><code>{
     "reviewer-test-index": {
        "aliases": {},
        "mappings": {
           "historyRecord": {
              "properties": {
                 "groupName": {
                    "type": "string"
                 },
                 "groupNo": {
                    "type": "integer"
                 },
                 "instrType": {
                    "type": "integer"
                 },
                 "instrumentAddress": {
                    "type": "string"
                 },
                 "insturmentName": {
                    "type": "string"
                 },
                 "macAddr": {
                    "type": "string"
                 },
                 "uhhVersion": {
                    "type": "string"
                 }
              }
           },         
        "settings": {
           "index": {
              "creation_date": "1434557536720",
              "number_of_shards": "1",
              "number_of_replicas": "0",
              "version": {
                 "created": "1050299"
              },
              "uuid": "FfQADLGVQVOPV3913exKsw"
           }
        },
        "warmers": {}
     }
  }
  </code></pre>
  
  <p>I also tried to make a JSON query but I get 0 hits:</p>
  
  <pre><code>GET _search
  {
    "query" :{
    "filtered": {
      "query": {
        "match_all": { }
      },
     "filter": {
        "bool" : {
              "must" : [
                  {"term" : { "macAddr" : "000A8D810F5A" } },
                  {"term" : { "insturmentName" : "Amin's furnace" } },
                  {"term" : { "instrumentAddress" : "8D810F5A"}},
                  {"term" : { "uhhVersion" :  "v2.5"}},
                  {"term" : { "groupName" :  "Amin's Group"}},
                  {"term" : { "groupNo" :  2}},
                  {"term" : { "instrType" :  60}}
              ]
           }
      }
    }
    }
  }
  
  Response:
  
  {
     "took": 3,
     "timed_out": false,
     "_shards": {
        "total": 4,
        "successful": 3,
        "failed": 0
     },
     "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
     }
  }
  </code></pre>