# Storing fields in \_source and nested values in a strict mapping

**URL:** <https://discuss.elastic.co/t/storing-fields-in--source-and-nested-values-in-a-strict-mapping/23019>\
**Category:** Elasticsearch\
**Created:** [March 31, 2015, 6:09pm UTC](https://discuss.elastic.co/t/storing-fields-in--source-and-nested-values-in-a-strict-mapping/23019 "2015-03-31T18:09:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Adepteo](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@Mark\_Adepteo](https://discuss.elastic.co/u/Mark_Adepteo)\
**Post date:** [March 31, 2015, 6:09pm UTC](https://discuss.elastic.co/t/storing-fields-in--source-and-nested-values-in-a-strict-mapping/23019/1 "2015-03-31T18:09:39Z")

</div>

Hi,

I seem to be having an issue with getting the \_source value to populate -  
I'm not sure why as I thought this happened on default - but it keeps  
coming back empty.

I also got the following error while trying to save the second value in a  
nested array ("end\_call\_info"). Do I need an "\_index" field and if so what  
values does it need?

{"error":"RemoteTransportException[[es004][inet[/172.16.2.202:9300]][indices:data/write/index]];  
nested: StrictDynamicMappingException[mapping set to strict, dynamic  
introduction of [\_index] within [cdr\_data] is not allowed]; ","status":400}

I made different changes to the mapping from:

1. changing "\_source" includes and enabled,
2. Changing "store" values for fields

The value is always the same:  
Example :

{

- "\_index": "cdr",
- "\_type": "cdr\_data",
- "\_id": "vs-1426792279.84561",
- "\_version": 1,
- "\_score": 1,
- "\_source": { }

}

Mapping is a follows:  
{  
"dynamic": "strict",  
"\_source":{  
"enabled":true,  
"includes": ["meta._", "doc._"]  
},  
"properties": {  
"uniqueid": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"context": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"start\_call\_info": {  
"type" : "nested",  
"properties": {  
"disposition": {  
"type": "string",  
"index": "not\_analyzed"  
}  
}  
},  
"end\_call\_info": {  
"type" : "nested",  
"properties": {  
"uniqueid": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"calldate": {  
"type": "date",  
"format": "date\_hour\_minute\_second",  
"store": true  
},  
"end\_calldate": {  
"type": "date",  
"format": "date\_hour\_minute\_second",  
"store": true  
},  
"clid": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"src": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"dst": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"dcontext": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"channel": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"dstchannel": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"lastapp": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"lastdata": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"duration": {  
"type": "long",  
"store": true  
},  
"billsec": {  
"type": "long",  
"store": true  
},  
"call\_direction": {  
"type": "string",  
"index": "not\_analyzed",  
"store":"no"  
},  
"disposition": {  
"type": "string",  
"index": "not\_analyzed",  
"store": "no"  
},  
"amaflags": {  
"type": "long",  
"index": "not\_analyzed",  
"store": true  
},  
"userfield": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"ip\_address": {  
"type": "ip",  
"store": true  
},  
"inb\_caller\_label": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"inb\_caller\_number": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"inb\_number\_dialled": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"int\_dst\_phone": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"location\_id": {  
"type": "long",  
"index": "not\_analyzed",  
},  
"int\_dst\_department\_id": {  
"type": "long",  
"index": "not\_analyzed",  
"store": true  
},  
"int\_src\_department\_id": {  
"type": "long",  
"index": "not\_analyzed",  
"store": true  
},  
"int\_dst\_agent\_id": {  
"type": "long",  
"index": "not\_analyzed",  
"store": true  
},  
"int\_src\_agent\_id": {  
"type": "long",  
"index": "not\_analyzed",  
"store": true  
}  
}  
}  
}  
}

Any help is greatly appreciated.

Thanks,  
Mark

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0b802246-1c54-46c8-85af-722d8a0fd58e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0b802246-1c54-46c8-85af-722d8a0fd58e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:22am UTC](https://discuss.elastic.co/t/storing-fields-in--source-and-nested-values-in-a-strict-mapping/23019/2 "2017-07-06T00:22:39Z")

</div>


