# Search unmapped fields

**URL:** <https://discuss.elastic.co/t/search-unmapped-fields/253188>\
**Category:** Elasticsearch\
**Created:** [October 24, 2020, 2:00am UTC](https://discuss.elastic.co/t/search-unmapped-fields/253188 "2020-10-24T02:00:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anantvir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anantvir/32/77809_2.png) [@anantvir](https://discuss.elastic.co/u/anantvir)\
**Post date:** [October 24, 2020, 2:00am UTC](https://discuss.elastic.co/t/search-unmapped-fields/253188/1 "2020-10-24T02:00:56Z")

</div>

Hello Everyone,

I want to add a new field mapping in existing index. The new field called 'transactions' is supposed to be an array of objects. Below is the sample 'transactions' field I want to store.

```auto
    TRANSACTIONS :[
    {
    	ControlNumber : 
    	{
    		orderSummary : {
    			orderNumber : 98,
    			orderDate : "",
    			scheduledQuantity :"",
    			startDate : ""
    		},
    		orderLineItems : {
    			identificationCode : [1,2,3,4],
    			unitOfMeasurement : [EA,EA,EA,EA],
    			GTINNumber : [23,45,67,321],
    			forecastDate : ["","","",""]
    		},
    		selected : true
    	}
    },
    	{
    	ControlNumber : {
    		orderSummary : {
    			orderNumber : 99,
    			orderDate : "",
    			scheduledQuantity :"",
    			startDate : ""
    		},
    		orderLineItems : {
    			identificationCode : [1,2,3,4],
    			unitOfMeasurement : [EA,EA,EA,EA],
    			GTINNumber : [23,45,67,321],
    			forecastDate : ["","","",""]
    		}
    	}},
           {
            ControlNumber : {
    		orderSummary : {
    			orderNumber : 100,
    			orderDate : "",
    			scheduledQuantity :"",
    			startDate : ""
    		},
    		orderLineItems : {
    			identificationCode : [1,2,3,4],
    			unitOfMeasurement : [EA,EA,EA,EA],
    			GTINNumber : [23,45,67,321],
    			forecastDate : ["","","",""]
    		}
    	}
    ]

```

The type of objects in the 'transactions' array can be of 10 different types depending on 10 types of orders I have. So these fields inside these objects do not have a pre defined structure, that is the reason I did not specify the fields in detail.  
Below is my mapping.

````
```PUT editxns/_mapping
{ 
  "dynamic" : false,
  "properties" :{
	"transactions":{
		"type" : "nested",
		"properties" : {
			"controlNumber" : {
				"type" : "nested",
				"properties":{
				  "orderSummary":{
				    "type" : "nested"
				  },
				  "orderLineItems":{
				    "type" : "nested"
				  }
				}
			}
		}
	}
	}
}```

````

ControlNumber will always have 2 sub objects called "orderSummary" and "orderLineItemDetails". Each of these 2 sub objects will have a key and corresponding value will be an array of strings or integers.

My question is that if I do not define mappings of these arrays because they can vary depening on 10 different order types, will I be able to include those arrays in search ?  
Please let me know if you need any further details or if my question is not clear.

---

<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:** [November 21, 2020, 2:01am UTC](https://discuss.elastic.co/t/search-unmapped-fields/253188/2 "2020-11-21T02:01:02Z")

</div>

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