Hello Jettro,
I find this behavior pretty normal. Although different people have
different opinions Here are my thoughts on the subject:
The second command is for getting a specific mapping. The point isn't for
you to see the full path, but only what you asked for, that's why it only
shows you the name of the mapping you requested.
The first command will give you all the mappings (corresponding to all the
types) of your index. It shows you the index name there because you need to
know which mapping you're looking at. It might look obvious, that
"gridshore" is the index name, because you requested it, but you can get
mappings for all indices, for example:
curl localhost:9200/_mapping?pretty
Or multiple indices and/or multiple types within them, like:
curl localhost:9200/test,test2/testmap1,testmap2/_mapping?pretty
In which case you need the index name in the returning JSON. So I think the
point is to have the index name only when you request multiple mappings -
that is, when you're likely to need it.
Best regards,
Radu
On Mon, Jul 8, 2013 at 5:45 PM, Jettro Coenradie <jettro.coenradie@gmail.com
wrote:
Hi,
I am using the _mapping api to learn more about the fields I have in my
mapping. One result seems weird to me when looking at the object returned.
http://localhost:9200/gridshore/_mapping?pretty
{
gridshore: {
blog: {
properties: {
...
}
}
}
}
http://localhost:9200/gridshore/blog/_mapping?pretty
{
blog: {
properties: {
...
}
}
}
So the index is omitted from the result. Is there is reason to do this, or
is it a bug?
thanks,
Jettro
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
http://sematext.com/ -- Elasticsearch -- Solr -- Lucene
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.