# Match on different fields

**URL:** <https://discuss.elastic.co/t/match-on-different-fields/192362>\
**Category:** Elasticsearch\
**Created:** [July 26, 2019, 6:07am UTC](https://discuss.elastic.co/t/match-on-different-fields/192362 "2019-07-26T06:07:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![likeElastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/likeelastic/32/50825_2.png) [@likeElastic](https://discuss.elastic.co/u/likeElastic)\
**Post date:** [July 26, 2019, 6:07am UTC](https://discuss.elastic.co/t/match-on-different-fields/192362/1 "2019-07-26T06:07:26Z")

</div>

I would like to search on different fields:

here is my search query:

{  
"index":"ats",  
"type":"candidate",  
"body":{  
"query":{  
"bool":{  
"must":{  
"term":{  
"skill":"python",  
"location":"romania"  
}  
}  
}  
}  
}  
}

Any kind of help is much appreciated.

---

<div class="post-metadata">

**Author:** ![luiz.santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luiz.santos/32/24664_2.png) [@luiz.santos](https://discuss.elastic.co/u/luiz.santos)\
**Post date:** [August 2, 2019, 12:45pm UTC](https://discuss.elastic.co/t/match-on-different-fields/192362/2 "2019-08-02T12:45:04Z")

</div>

Hi @likeElastic,

You may be interested in a bool query like this:

```auto
GET ats/candidate/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "skill": {
              "value": "python"
            }
          }
        },
        {
          "term": {
            "location": {
              "value": "romania"
            }
          }
        }
      ]
    }
  }
} 

```

Regards,  
Luiz Santos

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 30, 2019, 12:45pm UTC](https://discuss.elastic.co/t/match-on-different-fields/192362/3 "2019-08-30T12:45:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
