Disabling dynamic mapping

What does the json in the CURL request for this look like?

The dynamic creation of mappings for unmapped types can be completely
disabled by setting index.mapper.dynamic to false.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-dynamic-mapping.html#mapping-dynamic-mapping

Thanks!

  • Pulkit

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a9131f0a-3a3d-4617-96ac-d77c12d9d48c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

This is what I put into the elasticsearch.yml file when I start
Elasticsearch for use in a non-ELK environment:

Do not automatically create an index when a document is loaded, and do

not automatically index unknown (unmapped) fields:

action.auto_create_index: false
index.mapper.dynamic: false

And here's a complete example of a curl input document that I use to create
an index with the desired types in which I don't want new indices, new
types, or new fields to be automatically created:

{
"settings" : {
"index" : {
"number_of_shards" : 1,
"analysis" : {
"char_filter" : { },
"filter" : {
"english_snowball_filter" : {
"type" : "snowball",
"language" : "English"
}
},
"analyzer" : {
"english_standard_analyzer" : {
"type" : "custom",
"tokenizer" : "standard",
"filter" : [ "standard", "lowercase", "asciifolding" ]
},
"english_stemming_analyzer" : {
"type" : "custom",
"tokenizer" : "standard",
"filter" : [ "standard", "lowercase", "asciifolding",
"english_snowball_filter" ]
}
}
}
}
},
"mappings" : {
"default" : {
"dynamic" : "strict"
},
"person" : {
"_all" : {
"enabled" : false
},
"properties" : {
"telno" : {
"type" : "string",
"analyzer" : "english_standard_analyzer"
},
"gn" : {
"type" : "string",
"analyzer" : "english_standard_analyzer"
},
"sn" : {
"type" : "string",
"analyzer" : "english_stemming_analyzer"
},
"o" : {
"type" : "string",
"analyzer" : "english_stemming_analyzer"
}
}
}
}
}

By the way, I never mix indices that are used for more standard database
queries with the indices used by the ELK stack. Those are two separate
Elasticsearch clusters entirely; the former is locked down as shown above,
while the latter is left in its default "free form" method of automatically
creating indices and new fields on the fly, just as Splunk and ELK and
other log analysis tools do.

I hope this helps.

Brian

On Monday, November 10, 2014 10:45:38 AM UTC-5, pulkitsinghal wrote:

What does the json in the CURL request for this look like?

The dynamic creation of mappings for unmapped types can be completely
disabled by setting index.mapper.dynamic to false.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-dynamic-mapping.html#mapping-dynamic-mapping

Thanks!

  • Pulkit

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9b257ef5-3b87-43fe-a64b-1114da64d671%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.