[[properties]] === `properties` Type mappings, <> and <> contain sub-fields, called `properties`. These properties may be of any <>, including `object` and `nested`. Properties can be added: * explicitly by defining them when <>. * explicitly by defining them when adding or updating a mapping type with the <> API. * <> just by indexing documents containing new fields. Below is an example of adding `properties` to a mapping type, an `object` field, and a `nested` field: [source,console] -------------------------------------------------- PUT my_index { "mappings": { "properties": { <1> "manager": { "properties": { <2> "age": { "type": "integer" }, "name": { "type": "text" } } }, "employees": { "type": "nested", "properties": { <3> "age": { "type": "integer" }, "name": { "type": "text" } } } } } } PUT my_index/_doc/1 <4> { "region": "US", "manager": { "name": "Alice White", "age": 30 }, "employees": [ { "name": "John Smith", "age": 34 }, { "name": "Peter Brown", "age": 26 } ] } -------------------------------------------------- <1> Properties in the top-level mappings definition. <2> Properties under the `manager` object field. <3> Properties under the `employees` nested field. <4> An example document which corresponds to the above mapping. TIP: The `properties` setting is allowed to have different settings for fields of the same name in the same index. New properties can be added to existing fields using the <>. ==== Dot notation Inner fields can be referred to in queries, aggregations, etc., using _dot notation_: [source,console] -------------------------------------------------- GET my_index/_search { "query": { "match": { "manager.name": "Alice White" } }, "aggs": { "Employees": { "nested": { "path": "employees" }, "aggs": { "Employee Ages": { "histogram": { "field": "employees.age", "interval": 5 } } } } } } -------------------------------------------------- // TEST[continued] IMPORTANT: The full path to the inner field must be specified.