# Exact search not working with Nested multi field

**URL:** <https://discuss.elastic.co/t/exact-search-not-working-with-nested-multi-field/1764>\
**Category:** Elasticsearch\
**Created:** [June 2, 2015, 5:41pm UTC](https://discuss.elastic.co/t/exact-search-not-working-with-nested-multi-field/1764 "2015-06-02T17:41:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shobhit\_Tyagi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shobhit\_Tyagi](https://discuss.elastic.co/u/Shobhit_Tyagi)\
**Post date:** [June 2, 2015, 5:41pm UTC](https://discuss.elastic.co/t/exact-search-not-working-with-nested-multi-field/1764/1 "2015-06-02T17:41:22Z")

</div>

Hi Community,

I ran into an issue. I am trying to explore the multi field feature. If I use the following mapping, it all works well. I can search for exact match and fuzzy as well.

```
{
"mappings" : {
	"test" : {
		"properties" : {
			"value" : {
				"type" : "string",
				"fields": {
					"value-exact": { "type": "string", "index": "not_analyzed" }
				}
			}
		}
	}
}

```

}

However, if I group the field 'value' inside another then it doesnt really give me results for exact match. The mapping is following:

```
{
"mappings" : {
	"test" : {
		"properties" : {
			"topField" : {
				"properties" : {
					"value" : {
						"type" : "string",
						"fields": {
							"value-exact": { "type": "string", "index": "not_analyzed" }
						}
					}
				}
			}
		}
	}
}

```

}

I would really appreciate any help on this. Thanks.

---

<div class="post-metadata">

**Author:** ![Shobhit\_Tyagi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shobhit\_Tyagi](https://discuss.elastic.co/u/Shobhit_Tyagi)\
**Post date:** [June 3, 2015, 2:51pm UTC](https://discuss.elastic.co/t/exact-search-not-working-with-nested-multi-field/1764/2 "2015-06-03T14:51:23Z")

</div>

Anything on this please? Is this a bug/known issue?? Is there a work around? Thanks.

---

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [June 3, 2015, 3:32pm UTC](https://discuss.elastic.co/t/exact-search-not-working-with-nested-multi-field/1764/3 "2015-06-03T15:32:05Z")

</div>

Are you using [Inner Objects](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-object-type.html#mapping-object-type) or [Nested Objects](https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-objects.html)?

If you're using inner objects your mapping looks fine, what does your query look like? It should include the full path to the untokenized field:

```
{
    "query": {
        "term": {
            "topField.value.value-exact": "Elastic Search"
        }
    }
}

```

If you're using nested objects you will need to define the nested objects in your mapping and search using nested queries/filters.

Dan

---

<div class="post-metadata">

**Author:** ![Shobhit\_Tyagi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shobhit\_Tyagi](https://discuss.elastic.co/u/Shobhit_Tyagi)\
**Post date:** [June 3, 2015, 4:35pm UTC](https://discuss.elastic.co/t/exact-search-not-working-with-nested-multi-field/1764/4 "2015-06-03T16:35:37Z")

</div>

Thanks Dan.  
Not nested. Inner objects.  
Hmm. My query seems to be working if I use 'topField.value.value-exact'. Previously i was using 'topField.value-exact'.

But i dont get it. When I didnt have inner mapping, i just used 'value-exact'. And not 'value.value-exact'. And it was working fine. Why would it change for an inner object?

---

<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:** [July 6, 2017, 12:09am UTC](https://discuss.elastic.co/t/exact-search-not-working-with-nested-multi-field/1764/5 "2017-07-06T00:09:49Z")

</div>


