# Different content for \_source and what gets indexed. Possible?

**URL:** <https://discuss.elastic.co/t/different-content-for--source-and-what-gets-indexed-possible/9326>\
**Category:** Elasticsearch\
**Created:** [October 11, 2012, 6:49pm UTC](https://discuss.elastic.co/t/different-content-for--source-and-what-gets-indexed-possible/9326 "2012-10-11T18:49:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![es\_learner](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@es\_learner](https://discuss.elastic.co/u/es_learner)\
**Post date:** [October 11, 2012, 6:49pm UTC](https://discuss.elastic.co/t/different-content-for--source-and-what-gets-indexed-possible/9326/1 "2012-10-11T18:49:11Z")

</div>

Say, I have a document that I want to be in \_source as-is but I want to index only its abridged version.

How can I do that?

I'm using connection.bulk\_data.write() presently but can switch to using connection.index() or any other API that allows that.

Thanks!

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [October 11, 2012, 9:54pm UTC](https://discuss.elastic.co/t/different-content-for--source-and-what-gets-indexed-possible/9326/2 "2012-10-11T21:54:33Z")

</div>

es\_learner wrote:

> Say, I have a document that I want to be in \_source as-is but I  
> want to index only its abridged version.
> 
> How can I do that?

You'll need to supply a custom mapping when you create your index  
that turns off indexing of fields you wish to omit.

[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/)

-Drew

--

---

<div class="post-metadata">

**Author:** ![Chris\_Male](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_male/32/2607_2.png) [@Chris\_Male](https://discuss.elastic.co/u/Chris_Male)\
**Post date:** [October 11, 2012, 11:06pm UTC](https://discuss.elastic.co/t/different-content-for--source-and-what-gets-indexed-possible/9326/3 "2012-10-11T23:06:56Z")

</div>

Hi,

The content of \_source is exactly the JSON data was received by ES. It  
isnt changed in anyway. To change what is indexed, as Drew stated, you  
need to define a mapping for your content which can include different  
analysis components to change what is indexed.

On Friday, October 12, 2012 7:49:15 AM UTC+13, es\_learner wrote:

> Say, I have a document that I want to be in \_source as-is but I want to  
> index  
> only its abridged version.
> 
> How can I do that?
> 
> I'm using connection.bulk\_data.write() presently but can switch to using  
> connection.index() or any other API that allows that.
> 
> Thanks!
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Different-content-for-source-and-what-gets-indexed-Possible-tp4023820.html](http://elasticsearch-users.115913.n3.nabble.com/Different-content-for-source-and-what-gets-indexed-Possible-tp4023820.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![es\_learner](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@es\_learner](https://discuss.elastic.co/u/es_learner)\
**Post date:** [October 12, 2012, 1:11am UTC](https://discuss.elastic.co/t/different-content-for--source-and-what-gets-indexed-possible/9326/4 "2012-10-12T01:11:35Z")

</div>

Thanks, Drew.

That did it. FWIW mapping for field was index='no'

---

<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:09am UTC](https://discuss.elastic.co/t/different-content-for--source-and-what-gets-indexed-possible/9326/5 "2017-07-06T03:09:10Z")

</div>

Closed on July 6, 2017, 3:09am UTC


