API call to see the mappings of an existing index

Greetings,

I have couple of questions:

  1. Is there an API call that outputs the mappings of an existing index? I
    see how to get shard/replica info but could not find the call to print out
    the mappings of each of the fields.
  2. Is there a way to assign defaults (not analyzed etc) to fields that will
    be dynamically added later on?

Pointers to docs if they exist would be much appreciated.

Regards,
Berkay Mollamustafaoglu
mberkay on yahoo, google and skype

On 20/07/2010, at 10:21 AM, Berkay Mollamustafaoglu wrote:

Greetings,

I have couple of questions:

  1. Is there an API call that outputs the mappings of an existing index? I see how to get shard/replica info but could not find the call to print out the mappings of each of the fields.

I don't know that it's the way, but off the top of my head, I hit http://localhost:9200/_cluster/state which returns among other things the mappings on the nodes.

  1. Is there a way to assign defaults (not analyzed etc) to fields that will be dynamically added later on?

I'm not sure of exactly what you need to put in here, but it looks like this is what you're looking for: http://www.elasticsearch.com/docs/elasticsearch/index_modules/mapper/#Dynamic_Mappings

Andrew Harvey / Developer
lexer
m/
t/ +61 2 9019 6379
w/ http://lexer.com.au
Help put an end to whaling. Visit http://www.givewhalesavoice.com.au/

Please consider the environment before printing this email
This email transmission is confidential and intended solely for the person or organisation to whom it is addressed. If you are not the intended recipient, you must not copy, distribute or disseminate the information, or take any action in relation to it and please delete this e-mail. Any views expressed in this message are those of the individual sender, except where the send specifically states them to be the views of any organisation or employer. If you have received this message in error, do not open any attachment but please notify the sender (above). This message has been checked for all known viruses powered by McAfee.

For further information visit Advanced Research Center | Trellix
Please rely on your own virus check as no responsibility is taken by the sender for any damage rising out of any virus infection this communication may contain.

This message has been scanned for malware by Websense. www.websense.com

Some additions:

  1. The cluster state API gives you back the mappings for indices. In 0.9, if
    you are using the REST API, then there are three endpoints to get all
    mappings, all mappings for an index (or indices), and mappings for a
    specific index and type.

  2. You can use the put mapping API to define in advance mappings for
    specific fields. Is that what you are after?

-shay.banon

On Tue, Jul 20, 2010 at 8:29 PM, Andrew Harvey
Andrew.Harvey@lexer.com.auwrote:

On 20/07/2010, at 10:21 AM, Berkay Mollamustafaoglu wrote:

Greetings,

I have couple of questions:

  1. Is there an API call that outputs the mappings of an existing index?
    I see how to get shard/replica info but could not find the call to print
    out the mappings of each of the fields.

I don't know that it's the way, but off the top of my head, I hit
http://localhost:9200/_cluster/state which returns among other things the
mappings on the nodes.

  1. Is there a way to assign defaults (not analyzed etc) to fields that
    will be dynamically added later on?

I'm not sure of exactly what you need to put in here, but it looks like
this is what you're looking for:
http://www.elasticsearch.com/docs/elasticsearch/index_modules/mapper/#Dynamic_Mappings

Andrew Harvey / Developer
lexer
m/
t/ +61 2 9019 6379
w/ http://lexer.com.au
Help put an end to whaling. Visit http://www.givewhalesavoice.com.au/

Please consider the environment before printing this email
This email transmission is confidential and intended solely for the person
or organisation to whom it is addressed. If you are not the intended
recipient, you must not copy, distribute or disseminate the information, or
take any action in relation to it and please delete this e-mail. Any views
expressed in this message are those of the individual sender, except where
the send specifically states them to be the views of any organisation or
employer. If you have received this message in error, do not open any
attachment but please notify the sender (above). This message has been
checked for all known viruses powered by McAfee.

For further information visit
Advanced Research Center | Trellix
Please rely on your own virus check as no responsibility is taken by the
sender for any damage rising out of any virus infection this communication
may contain.

This message has been scanned for malware by Websense. www.websense.com

For 2 I think I was after what Andrew pointed to. I read it again after
Andrew pointed out and this time it made sense.
It's not defining advanced mappings for specific fields as I don't know what
the fields will be. I just want to be able to configure the defaults for any
additional fields to not_analyzed, etc.

I take it I can specify that in the default of dynamic mappings as
described in that page?

Regards,
Berkay Mollamustafaoglu
mberkay on yahoo, google and skype

On Tue, Jul 20, 2010 at 1:32 PM, Shay Banon shay.banon@elasticsearch.comwrote:

Some additions:

  1. The cluster state API gives you back the mappings for indices. In 0.9,
    if you are using the REST API, then there are three endpoints to get all
    mappings, all mappings for an index (or indices), and mappings for a
    specific index and type.

  2. You can use the put mapping API to define in advance mappings for
    specific fields. Is that what you are after?

-shay.banon

On Tue, Jul 20, 2010 at 8:29 PM, Andrew Harvey <Andrew.Harvey@lexer.com.au

wrote:

On 20/07/2010, at 10:21 AM, Berkay Mollamustafaoglu wrote:

Greetings,

I have couple of questions:

  1. Is there an API call that outputs the mappings of an existing index?
    I see how to get shard/replica info but could not find the call to print
    out the mappings of each of the fields.

I don't know that it's the way, but off the top of my head, I hit
http://localhost:9200/_cluster/state which returns among other things the
mappings on the nodes.

  1. Is there a way to assign defaults (not analyzed etc) to fields that
    will be dynamically added later on?

I'm not sure of exactly what you need to put in here, but it looks like
this is what you're looking for:
http://www.elasticsearch.com/docs/elasticsearch/index_modules/mapper/#Dynamic_Mappings

Andrew Harvey / Developer
lexer
m/
t/ +61 2 9019 6379
w/ http://lexer.com.au
Help put an end to whaling. Visit http://www.givewhalesavoice.com.au/

Please consider the environment before printing this email
This email transmission is confidential and intended solely for the person
or organisation to whom it is addressed. If you are not the intended
recipient, you must not copy, distribute or disseminate the information, or
take any action in relation to it and please delete this e-mail. Any views
expressed in this message are those of the individual sender, except where
the send specifically states them to be the views of any organisation or
employer. If you have received this message in error, do not open any
attachment but please notify the sender (above). This message has been
checked for all known viruses powered by McAfee.

For further information visit
Advanced Research Center | Trellix
Please rely on your own virus check as no responsibility is taken by the
sender for any damage rising out of any virus infection this communication
may contain.

This message has been scanned for malware by Websense. www.websense.com