# Big mapping example?

**URL:** <https://discuss.elastic.co/t/big-mapping-example/4975>\
**Category:** Elasticsearch\
**Created:** [July 27, 2011, 11:45am UTC](https://discuss.elastic.co/t/big-mapping-example/4975 "2011-07-27T11:45:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarjei\_Huse](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tarjei_huse/32/3072_2.png) [@Tarjei\_Huse](https://discuss.elastic.co/u/Tarjei_Huse)\
**Post date:** [July 27, 2011, 11:45am UTC](https://discuss.elastic.co/t/big-mapping-example/4975/1 "2011-07-27T11:45:29Z")

</div>

Hi, is there a lagre(ish) example of an indexmapping somewhere in the ES  
docs? I'm just starting to dip my toes into ES now.

I'm asking because it would be great to have a document like that to begin  
using ES - just like Solr has a large commented solrconfig.xml and  
schema.xml file that may be used as a startingpoint for setting it up.

Regards,  
Tarjei

---

<div class="post-metadata">

**Author:** ![Vladimir\_Shkurin](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@Vladimir\_Shkurin](https://discuss.elastic.co/u/Vladimir_Shkurin)\
**Post date:** [July 27, 2011, 12:29pm UTC](https://discuss.elastic.co/t/big-mapping-example/4975/2 "2011-07-27T12:29:50Z")

</div>

Yes, lots of examples (especially not the standard 🙂 would be cool!

Maybe it can help you, here are some examples:

> <https://gist.github.com/kimchy/879883>

> <https://gist.github.com/anonymous/851600>

> <https://gist.github.com/anonymous/853994>

> <https://gist.github.com/karmi/1051213>

[http://www.elasticsearch.org/guide/reference/mapping/core-types.html](http://www.elasticsearch.org/guide/reference/mapping/core-types.html)

[http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html](http://www.elasticsearch.org/guide/reference/index-modules/analysis/custom-analyzer.html)

> **[Your Data, Your Search
	  	 | Elastic](https://www.elastic.co/blog/your-data-your-search)**
>
> One of the main aspects when working with business data is to try and have all different components in an ever evolving system to understand the same data structure/format (or as close as possible). T...

---

<div class="post-metadata">

**Author:** ![Tarjei\_Huse](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tarjei_huse/32/3072_2.png) [@Tarjei\_Huse](https://discuss.elastic.co/u/Tarjei_Huse)\
**Post date:** [July 27, 2011, 1:01pm UTC](https://discuss.elastic.co/t/big-mapping-example/4975/3 "2011-07-27T13:01:31Z")

</div>

Great!

Thanks.

As I understand it, when you index a document in ES you can either define a  
fields properties (in the mapping) when creating the index, but also when  
you index the document, am I correct?

What happens if the two field definitions conflict?

Regards,  
Tarjei

---

<div class="post-metadata">

**Author:** ![Vladimir\_Shkurin](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@Vladimir\_Shkurin](https://discuss.elastic.co/u/Vladimir_Shkurin)\
**Post date:** [July 27, 2011, 2:03pm UTC](https://discuss.elastic.co/t/big-mapping-example/4975/4 "2011-07-27T14:03:22Z")

</div>

On the first your question.

1. You define the settings of the index (analyzers, filters,  
tokenizers)
2. You define the mappings. Here you can specify many options, field  
name, field type, use an index or not, what fields to use your  
analyzers (index\_analyzer, search\_analyzer), see the documentation  
"Mapping -\> Types -\> core".
3. Put your data, example:

{  
"tweet" {  
"user" : "kimchy"  
"message" : "This is a tweet!",  
"postDate" : "2009-11-15T14:12:12",  
"retweets" : 4,  
}  
}

The search should work 🙂

On the second your question I don't know, I use ElasticSearch only the  
third day 🙂

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 27, 2011, 5:33pm UTC](https://discuss.elastic.co/t/big-mapping-example/4975/5 "2011-07-27T17:33:16Z")

</div>

Mappings can be explicitly defined when you create an index, or use the put  
mapping API. If you don't specify it, then automatic mappings will be  
created based on the field indexed (for example, if its a number, then it  
will be indexed as one).

On Wed, Jul 27, 2011 at 4:01 PM, Tarjei Huse [tarjei.huse@gmail.com](mailto:tarjei.huse@gmail.com) wrote:

> Great!
> 
> Thanks.
> 
> As I understand it, when you index a document in ES you can either define a  
> fields properties (in the mapping) when creating the index, but also when  
> you index the document, am I correct?
> 
> What happens if the two field definitions conflict?
> 
> Regards,  
> Tarjei

---

<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, 3:59am UTC](https://discuss.elastic.co/t/big-mapping-example/4975/6 "2017-07-06T03:59:01Z")

</div>


