# Custom field mapping

**URL:** https://discuss.elastic.co/t/custom-field-mapping/19586
**Category:** Elasticsearch
**Created:** [September 3, 2014, 8:23am UTC](https://discuss.elastic.co/t/custom-field-mapping/19586 "2014-09-03T08:23:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CB1](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@CB1](https://discuss.elastic.co/u/CB1)
#### Post date: [September 3, 2014, 8:23am UTC](https://discuss.elastic.co/t/custom-field-mapping/19586/1 "2014-09-03T08:23:11Z")

</div>

hi all,

Sorry for the basic question - I'll appreciate any help 🙂

I configured the field mapping of my index using the following json struct:

{ "template" : "_", "order" : 10, "mappings" : { "couchbaseCheckpoint" : {  
"\_source" : { "includes" : ["doc._"] }, "dynamic\_templates": [ {  
"store\_no\_index": { "match": "_", "mapping": { "store" : "no", "index" :  
"no", "include\_in\_all" : false } } } ] }, "default" : { "\_source" : {  
"includes" : ["meta._"] }, "properties" : { "meta" : { "type" : "object",  
"include\_in\_all" : false } } } }}

A typical document that I'm inserting looks like this:

{  
"meta": {  
"id": "1234",  
"rev": "1-0001e50821cebfb80000000000000000",  
"expiration": 0,  
"flags": 0  
},  
"doc": {  
"date": 12123321312  
}  
}

Now for the question - How to customize the mapping definition described  
above so that the field "date" will be parsed as date (epoc time format)  
and not as the result of auto mapping (type long).

--  
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/46830de7-a757-4cf1-9e4c-cba84121ddf1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46830de7-a757-4cf1-9e4c-cba84121ddf1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [September 3, 2014, 9:34am UTC](https://discuss.elastic.co/t/custom-field-mapping/19586/2 "2014-09-03T09:34:51Z")

</div>

Hello CB ,

You can declare it as normal time type and it should be able to identify  
epoch format be default.

"The date type will also accept a long number representing UTC milliseconds  
since the epoch, regardless of the format it can handle.  
" from

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Thanks  
Vineeth

On Wed, Sep 3, 2014 at 1:53 PM, CB [chen.bekor@gmail.com](mailto:chen.bekor@gmail.com) wrote:

> hi all,
> 
> Sorry for the basic question - I'll appreciate any help 🙂
> 
> I configured the field mapping of my index using the following json struct:
> 
> { "template" : "_", "order" : 10, "mappings" : { "couchbaseCheckpoint" : {  
> "\_source" : { "includes" : ["doc._"] }, "dynamic\_templates": [ {  
> "store\_no\_index": { "match": "_", "mapping": { "store" : "no", "index" :  
> "no", "include\_in\_all" : false } } } ] }, "default" : { "\_source" : {  
> "includes" : ["meta._"] }, "properties" : { "meta" : { "type" : "object",  
> "include\_in\_all" : false } } } }}
> 
> A typical document that I'm inserting looks like this:
> 
> {  
> "meta": {  
> "id": "1234",  
> "rev": "1-0001e50821cebfb80000000000000000",  
> "expiration": 0,  
> "flags": 0  
> },  
> "doc": {  
> "date": 12123321312  
> }  
> }
> 
> Now for the question - How to customize the mapping definition described  
> above so that the field "date" will be parsed as date (epoc time format)  
> and not as the result of auto mapping (type long).
> 
> --  
> 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/46830de7-a757-4cf1-9e4c-cba84121ddf1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46830de7-a757-4cf1-9e4c-cba84121ddf1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/46830de7-a757-4cf1-9e4c-cba84121ddf1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46830de7-a757-4cf1-9e4c-cba84121ddf1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAGdPd5mHGnD-\_HtyF0wipQRFcogPnCEfyj-rsb-ekUAVNrVDow%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mHGnD-_HtyF0wipQRFcogPnCEfyj-rsb-ekUAVNrVDow%40mail.gmail.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, 1:04am UTC](https://discuss.elastic.co/t/custom-field-mapping/19586/3 "2017-07-06T01:04:41Z")

</div>


