# Match and term in bool's should

**URL:** <https://discuss.elastic.co/t/match-and-term-in-bools-should/206522>\
**Category:** Elasticsearch\
**Created:** [November 5, 2019, 5:40am UTC](https://discuss.elastic.co/t/match-and-term-in-bools-should/206522 "2019-11-05T05:40:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ecenma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ecenma/32/57140_2.png) [@Ecenma](https://discuss.elastic.co/u/Ecenma)\
**Post date:** [November 5, 2019, 5:40am UTC](https://discuss.elastic.co/t/match-and-term-in-bools-should/206522/1 "2019-11-05T05:40:33Z")

</div>

I'd like to search items that either have `firstField` (mapped as text) similar to a query string or `secondField` (mapped as an integer) equal to, say, 1.

After reading the docs, I understand the OR I am trying to implement can be done with a `should` clause inside a `bool` like so:

```auto
{
  "query": {
    "bool": {
      "should": [
        {"match": {"firstField": "queryString"}},
        {"term": {"secondField": 1}}
      ]
    }
  }
}

```

The results however show that `secondField` contributes far less (approximately 4 times) to the result than `firstField` does since their scoring algorithms are different. `firstField` effectively eclipses `secondField`, even though I want them to weigh the same on the final score.

My question is twofold:

- is it even recommended to have a `match` inside a `should` (or any other `bool` sub-clause) since the result is non-boolean?
- how can I make two clauses of different natures (in this case `match` and `term`) weigh the same on the final score (have the same scoring span)?

---

<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:** [December 3, 2019, 5:40am UTC](https://discuss.elastic.co/t/match-and-term-in-bools-should/206522/2 "2019-12-03T05:40:41Z")

</div>

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