Thanks Olivier,
With your help, I found what was wrong.
My use case was :
-
Push one document to ES -> so dynamic mapping start
-
Create json mapping file and put it in
mappings/indexName/typeName.json
-
Get the json mapping
When I ask for the mapping,
http://localhost:9200/indexName/typeName/_mapping I get only the first one.
To make it working, I have to :
-
Clean my ES cluster
-
Create json mapping file and put it in
mappings/indexName/typeName.json
-
Push one document to ES -> so mapping defined in config file is
applied
-
Get the json mapping
So, as Shay told before (If I understood correctly), its really better to
push the mapping through an http/Rest request than setting up all nodes
Perhaps, it could be useful for others to write in the
http://www.elasticsearch.org/guide/reference/mapping/conf-mappings.html
documentation, that its not a good practice to define mappings with config
files
Thanks to all
David.
De : ofavre [mailto:olivier@yakaz.com]
Envoyé : lundi 23 mai 2011 17:15
À : users@elasticsearch.com
Objet : Re: _id and mappings
My configuration is as follows:
-
config
-
elasticsearch.yml
-
mappings
-
indexName
-
typeName.json
I tell nothing peculiar inside elasticsearch.yml. (You can change settings
of the default file name/path for the default mapping, but I don't use it).
My typeName.json looks as follows (trimmed down):
{
  "typeName" : {
    "_source" : {"enabled":false},
    "dynamic" : "strict",
    "properties" : {
      "text" : {"type":"string", "index":"analyzed",
"store":true, "include_in_all":false, "analyzer":"simple"}
    }
  }
}
Hope that helps.
Cheers
--
Olivier Favre
http://www.yakaz.com/img/logo_yakaz_small.png
http://www.yakaz.com www.yakaz.com