Questions about field mapping unicity and filter context transitivity

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.

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