# Custom JSON field indexing and gateway need

**URL:** <https://discuss.elastic.co/t/custom-json-field-indexing-and-gateway-need/4425>\
**Category:** Elasticsearch\
**Created:** [May 17, 2011, 4:33pm UTC](https://discuss.elastic.co/t/custom-json-field-indexing-and-gateway-need/4425 "2011-05-17T16:33:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalit\_mishra](https://avatars.discourse-cdn.com/v4/letter/l/b77776/32.png) [@lalit\_mishra](https://discuss.elastic.co/u/lalit_mishra)\
**Post date:** [May 17, 2011, 4:33pm UTC](https://discuss.elastic.co/t/custom-json-field-indexing-and-gateway-need/4425/1 "2011-05-17T16:33:44Z")

</div>

Hi All,  
I am a bit new to elastic search and would like your views on below points.

1. If I have a JSON object with 100 fields and i want elastic search  
to index only 30 fields and ignore remaining 70 fields but still store the  
original json source as \_source Is this possible within elastic search ? and  
how ?

2. If all the request which is made to the elastic search data node is  
persisted on a file system then do I need to have a gateway ?

Thanks in advance for your help.

Regards,  
Lalit.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [May 17, 2011, 4:42pm UTC](https://discuss.elastic.co/t/custom-json-field-indexing-and-gateway-need/4425/2 "2011-05-17T16:42:01Z")

</div>

Hi Lalit

> 1. If I have a JSON object with 100 fields and i want Elasticsearch  
> to index only 30 fields and ignore remaining 70 fields but still store  
> the original json source as \_source Is this possible within elastic  
> search ? and how ?

Yes it is. Just set the mapping for those fields you don't want to be  
indexed to { "index": "no"}

> **[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.

> 1. If all the request which is made to the Elasticsearch data node is  
> persisted on a file system then do I need to have a gateway ?

By default, Elasticsearch uses the "local" gateway, so all data is  
stored in the data/ dir (which also doubles as the working dir).

You don't need any other gateway than this, unless you have some  
specific purpose.

clint

---

<div class="post-metadata">

**Author:** ![lalit\_mishra](https://avatars.discourse-cdn.com/v4/letter/l/b77776/32.png) [@lalit\_mishra](https://discuss.elastic.co/u/lalit_mishra)\
**Post date:** [May 17, 2011, 4:50pm UTC](https://discuss.elastic.co/t/custom-json-field-indexing-and-gateway-need/4425/3 "2011-05-17T16:50:38Z")

</div>

Thanks for your help I will continue towards understanding Elasticsearch 🙂

On Tue, May 17, 2011 at 10:12 PM, Clinton Gormley  
[clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> Hi Lalit
> 
> > 1. If I have a JSON object with 100 fields and i want Elasticsearch  
> > to index only 30 fields and ignore remaining 70 fields but still store  
> > the original json source as \_source Is this possible within elastic  
> > search ? and how ?
> 
> Yes it is. Just set the mapping for those fields you don't want to be  
> indexed to { "index": "no"}
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types.html)
> 
> > 1. If all the request which is made to the Elasticsearch data node is  
> > persisted on a file system then do I need to have a gateway ?
> 
> By default, Elasticsearch uses the "local" gateway, so all data is  
> stored in the data/ dir (which also doubles as the working dir).
> 
> You don't need any other gateway than this, unless you have some  
> specific purpose.
> 
> clint

---

<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, 4:05am UTC](https://discuss.elastic.co/t/custom-json-field-indexing-and-gateway-need/4425/4 "2017-07-06T04:05:57Z")

</div>


