# Demo project for building mappers

**URL:** <https://discuss.elastic.co/t/demo-project-for-building-mappers/10123>\
**Category:** Elasticsearch\
**Created:** [December 19, 2012, 4:11pm UTC](https://discuss.elastic.co/t/demo-project-for-building-mappers/10123 "2012-12-19T16:11:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 19, 2012, 4:11pm UTC](https://discuss.elastic.co/t/demo-project-for-building-mappers/10123/1 "2012-12-19T16:11:51Z")

</div>

Heya,

I just pushed a demo project for building your own mappers.  
The main idea of this is to help users (like me) to create your own mappers.

I will probably submit a blog post on that in some days/weeks.

The git repo is here: [https://github.com/dadoonet/elasticsearch-mapper-demo](https://github.com/dadoonet/elasticsearch-mapper-demo)  
[https://github.com/dadoonet/elasticsearch-mapper-demo](https://github.com/dadoonet/elasticsearch-mapper-demo)

This demo mapper define a new type called "demo".

You can define your mapping like this:

{  
"person" : {  
"properties" : {  
"my\_demo" : { "type" : "demo" }  
}  
}  
}

And then send a document like this:

{  
"my\_demo" : "this is a lowercase sentence"  
}

It will create another field under my\_demo.demo which contains your field but in  
upper case (hey, that's just a demo! 😉 )

If you have defined your mapping like this:

{  
"person" : {  
"properties" : {  
"my\_demo" : {  
"type" : "demo",  
"fields" : {  
"demo" : {"index" : "not\_analyzed"}  
}  
}  
}  
}  
}

You should be able to create a Term Query (not analyzed) on my\_demo.demo with  
"THIS IS A LOWERCASE SENTENCE".

Also, you can have a look at integration tests...

Hope this will help some of you.

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<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:59am UTC](https://discuss.elastic.co/t/demo-project-for-building-mappers/10123/2 "2017-07-06T02:59:16Z")

</div>

Closed on July 6, 2017, 2:59am UTC


