On Fri, 2013-02-22 at 07:53 -0800, Christopher J. Bottaro wrote:
In the yaml config file? Or is it a part of an index's mapping? Can
you give an example of how to use that setting?
You can use it when you specify the mapping, eg at index creation time:
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d '
{
"mappings" : {
"mytype" : {
"dynamic" : "strict",
"properties" : {
"foo" : {
"type" : "string"
}
}
}
}
}
'
You can also set it for all types in an index by specifying the default
mapping:
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d '
{
"mappings" : {
"default" : {
"dynamic" : "strict"
}
}
}
'
clint
Thanks for the info.
On Thursday, February 21, 2013 4:10:58 AM UTC-6, hazzadous wrote:
In this case, you can specify dynamic: "strict". Any attempt
to index an unmapped field will cause the op to fail.
On Wednesday, 20 February 2013 17:25:47 UTC, Christopher J.
Bottaro wrote:
How about if I want an error raised if I try to index
a field that's not defined as a part of the mapping?
Thanks.
On Friday, February 8, 2013 4:15:14 AM UTC-6, Michael
Kleen wrote:
Hello,
if you want to disable the dynamic mapping on
the root level of your object as you asked for
and not on the complete index
as Radu mentioned you can do it in the
following way:
https://gist.github.com/mkleen/4942355b8af22daa4a4e
This will not prevent that an object gets
created with unmapped fields, but it wont
create a dynamic field in the index as shown
above in the example.
Regards,
Michael
On Thursday, February 7, 2013 11:17:30 PM UTC
+1, T Vinod Gupta wrote:
i wanted to disable dynamic mapping
for my indices.. but it is somehow not
working for me.. i looked at the
documentation and im still getting
confused.. tried couple of things and
it didnt work.
does anyone have a working example?
e.g., i tried the below and that didnt
work -
{ "number_of_shards" : 2,
"mapper.dynamic" : false
}
i looked at this link
- http://www.elasticsearch.org/guide/reference/mapping/object-type.html
it doesnt really tell how to disable
at root level.
thanks
--
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.
--
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.