# Multiple search clauses and filtering?

**URL:** <https://discuss.elastic.co/t/multiple-search-clauses-and-filtering/158591>\
**Category:** Elasticsearch\
**Created:** [November 28, 2018, 2:51pm UTC](https://discuss.elastic.co/t/multiple-search-clauses-and-filtering/158591 "2018-11-28T14:51:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Repox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/repox/32/38200_2.png) [@Repox](https://discuss.elastic.co/u/Repox)\
**Post date:** [November 28, 2018, 2:51pm UTC](https://discuss.elastic.co/t/multiple-search-clauses-and-filtering/158591/1 "2018-11-28T14:51:14Z")

</div>

Hello.

I'm trying to search trough my items and I'm trying to achieve a combination of a wildcard search and an exact match on two different fields and finally filtering out the results.

My current request looks like this:

```
{
	"query": {
		"bool": {
			"must": {
				"wildcard": {
					"name": "*leje*"
				}
			},
			"should": [
								{ "match": { "sku": "leje" }}

			],
			"filter": [
				{
					"term": {
						"tenant": "specificshop"
					}
				}
			]
		}
	}
}

```

I'm getting the results filtered correctly and I'm also getting documents that matches the wildcard search, but the document that has a `sku` with the exact value doesn't show up.

I'm probably misunderstanding the usage of something, but I can't seem to figure out what I'm doing wrong.

Any input is appreciated.

---

<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 26, 2018, 2:51pm UTC](https://discuss.elastic.co/t/multiple-search-clauses-and-filtering/158591/2 "2018-12-26T14:51:17Z")

</div>

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