Custom JSON field indexing and gateway need


(lalit mishra) #1

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.


(Clinton Gormley) #2

Hi Lalit

  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 ?

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

http://www.elasticsearch.org/guide/reference/mapping/core-types.html

  1. 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 ?

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


(lalit mishra) #3

Thanks for your help I will continue towards understanding elastic search :slight_smile:

On Tue, May 17, 2011 at 10:12 PM, Clinton Gormley
clinton@iannounce.co.ukwrote:

Hi Lalit

  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 ?

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

http://www.elasticsearch.org/guide/reference/mapping/core-types.html

  1. 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 ?

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


(system) #4