Sorry, I'm new to ElasticSearch.
http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html
This document says you can "creates a mapping called tweet within the twitter index"
$ curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '
{
"tweet" : {
"properties" : {
"message" : {"type" : "string", "store" : "yes"}
}
}
}
'
As someone told me on ES IRC channel, /twitter/tweet twitter=index, tweet=type
But what happens if I do the following?
$ curl -XPUT 'http://localhost:9200/twitter/XXX/_mapping' -d '
{
"YYY" : {
"properties" : {
"message" : {"type" : "string", "store" : "yes"}
}
}
}
'
If I already provided the type name in the url, why should i still provide a type name in the content? If I provide the type name in the content, why can't I just call some url like:
$ curl -XPUT 'http://localhost:9200/twitter/_mapping' -d '
While reading the doc, for me it says "creates a mapping called tweet within the twitter index", this means XXX is the mapping name and YYY is the type name.
Thus if there is a mapping name, there can normally be many "mappings" for an index
So, in the end, XXX and YYY are/should be the same?
It's not what i understand from the doc, but what I think is: - One index can have types - Types have a mapping Thus we don't create a mapping like the documentation says, but we create a type, that has a mapping, or we update the type's mapping no?
And on an index where I don't want to use any type (all documents indexed are the same kind of data), but I want to create a mapping for that index, am I supposed to handle that by creating only one type with its mapping, and always use that type (in the CouchDB river for example)?
Thanks