# Problem defining a template

**URL:** <https://discuss.elastic.co/t/problem-defining-a-template/13767>\
**Category:** Elasticsearch\
**Created:** [September 26, 2013, 5:56pm UTC](https://discuss.elastic.co/t/problem-defining-a-template/13767 "2013-09-26T17:56:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![imarsman](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@imarsman](https://discuss.elastic.co/u/imarsman)\
**Post date:** [September 26, 2013, 5:56pm UTC](https://discuss.elastic.co/t/problem-defining-a-template/13767/1 "2013-09-26T17:56:34Z")

</div>

I am having a problem defining a template to match up against data I would  
like to index. I have removed extraneous fields from the template and  
summarized the template and given a sample curl invocation and the error  
message I am getting in the following gist:

> <https://gist.github.com/anonymous/c6a7c2063a4f696c79aa>
>
> There are more than three files. show original

and the following error when trying to index a test document:

{"error":"MapperParsingException[mapping [date]]; nested:  
MapperParsingException[Trying to parse an object but has a different type  
[date] for [date]]; ","status":400}

I would very much appreciate very much any pointers as to what I have done  
wrong that could be triggering this error. This has been driving me crazy  
for several hours now.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 1, 2013, 7:49am UTC](https://discuss.elastic.co/t/problem-defining-a-template/13767/2 "2013-10-01T07:49:52Z")

</div>

Hey,

I tried to reproduce your problem, but didnt get an error on indexing (is  
it possible that the file you specified using curl -T is still an old  
version, I tried your curl call without using -T and it worked with the  
data you supplied).

--Alex

On Thu, Sep 26, 2013 at 7:56 PM, Ian Marsman [ian.marsman@gmail.com](mailto:ian.marsman@gmail.com) wrote:

> I am having a problem defining a template to match up against data I would  
> like to index. I have removed extraneous fields from the template and  
> summarized the template and given a sample curl invocation and the error  
> message I am getting in the following gist:
> 
> [Problematic template mapping · GitHub](https://gist.github.com/anonymous/c6a7c2063a4f696c79aa)
> 
> and the following error when trying to index a test document:
> 
> {"error":"MapperParsingException[mapping [date]]; nested:  
> MapperParsingException[Trying to parse an object but has a different type  
> [date] for [date]]; ","status":400}
> 
> I would very much appreciate very much any pointers as to what I have done  
> wrong that could be triggering this error. This has been driving me crazy  
> for several hours now.
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![imarsman](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@imarsman](https://discuss.elastic.co/u/imarsman)\
**Post date:** [October 16, 2013, 11:42pm UTC](https://discuss.elastic.co/t/problem-defining-a-template/13767/3 "2013-10-16T23:42:40Z")

</div>

Hello. I am not sure what the problem is, whether it is valid or not, but I  
have ended up writing a script that handles document template creation  
based on index path and that is working fine. Thanks for looking into it!

On Tuesday, October 1, 2013 12:49:52 AM UTC-7, Alexander Reelsen wrote:

> Hey,
> 
> I tried to reproduce your problem, but didnt get an error on indexing (is  
> it possible that the file you specified using curl -T is still an old  
> version, I tried your curl call without using -T and it worked with the  
> data you supplied).
> 
> --Alex
> 
> On Thu, Sep 26, 2013 at 7:56 PM, Ian Marsman \<[ian.m...@gmail.com](mailto:ian.m...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I am having a problem defining a template to match up against data I  
> > would like to index. I have removed extraneous fields from the template and  
> > summarized the template and given a sample curl invocation and the error  
> > message I am getting in the following gist:
> > 
> > [Problematic template mapping · GitHub](https://gist.github.com/anonymous/c6a7c2063a4f696c79aa)
> > 
> > and the following error when trying to index a test document:
> > 
> > {"error":"MapperParsingException[mapping [date]]; nested:  
> > MapperParsingException[Trying to parse an object but has a different type  
> > [date] for [date]]; ","status":400}
> > 
> > I would very much appreciate very much any pointers as to what I have  
> > done wrong that could be triggering this error. This has been driving me  
> > crazy for several hours now.
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:12am UTC](https://discuss.elastic.co/t/problem-defining-a-template/13767/4 "2017-07-06T02:12:02Z")

</div>


