# Questions about field mapping unicity and filter context transitivity

**URL:** <https://discuss.elastic.co/t/questions-about-field-mapping-unicity-and-filter-context-transitivity/118817>\
**Category:** Elasticsearch\
**Created:** [February 7, 2018, 11:08am UTC](https://discuss.elastic.co/t/questions-about-field-mapping-unicity-and-filter-context-transitivity/118817 "2018-02-07T11:08:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier-L](https://avatars.discourse-cdn.com/v4/letter/o/7feea3/32.png) [@Olivier-L](https://discuss.elastic.co/u/Olivier-L)\
**Post date:** [February 7, 2018, 11:08am UTC](https://discuss.elastic.co/t/questions-about-field-mapping-unicity-and-filter-context-transitivity/118817/1 "2018-02-07T11:08:14Z")

</div>

Hello,

I have two questions:

1. I know that a field mapping (with same name) must be unique accross types in an index, but does this apply also when the field is inside two different objects?

Like:

```
"mappings": {
  "type1": {
	"properties": {
	  "Object1": {
		"properties": {
		  "Field1": {
			"type": "string"
		  }
		}
	  },
	  "Object2": {
		"properties": {
		  "Field1": {
			"type": "integer"
		  }
		}
	  }
	}
  }
}

```

To make it short, is Object1.Field1 the same field as Object2.Field1 or are they differents, and so, can have a different mapping, because they are not in the same scope/namespace?

1. I would like to know if a filter "context" is transmitted to all its sub-queries.

For instance:

```
"query": {
	"bool": {
		"filter": {
			"bool": {
				"must": 
				[
					{"term": ...},
					...
				],
				"should:
				[
					{"term": ...},
					...
				]
			}
		},
		"must": [...]
	}
}

```

Do both the "term" queries above operate in the filter context introduced by the first "bool" query?  
Or do we have to wrap them again in a "filter" clause in the second "bool" query?

Thanks

Olivier L.

---

<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:** [March 7, 2018, 11:09am UTC](https://discuss.elastic.co/t/questions-about-field-mapping-unicity-and-filter-context-transitivity/118817/2 "2018-03-07T11:09:02Z")

</div>

Closed on March 7, 2018, 11:09am UTC

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