Browse Source

Document strict dynamic type mapping.

Matt Weber 12 years ago
parent
commit
1e0a834c68
1 changed files with 21 additions and 1 deletions
  1. 21 1
      docs/reference/mapping/dynamic-mapping.asciidoc

+ 21 - 1
docs/reference/mapping/dynamic-mapping.asciidoc

@@ -31,7 +31,27 @@ different location). It can also be explicitly set using the
 The dynamic creation of mappings for unmapped types can be completely
 disabled by setting `index.mapper.dynamic` to `false`.
 
-As an example, here is how we can change the default
+The dynamic creation of fields within a type can be completely
+disabled by setting the `dynamic` property of the type to `strict`.
+
+Here is a <<indices-put-mapping,Put Mapping>> example that
+disables dynamic field creation for a `tweet`:
+
+[source,js]
+--------------------------------------------------
+$ curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '
+{
+    "tweet" : {
+        "dynamic": "strict",
+        "properties" : {
+            "message" : {"type" : "string", "store" : "yes"}
+        }
+    }
+}
+'
+--------------------------------------------------
+
+Here is how we can change the default
 <<mapping-date-format,date_formats>> used in the
 root and inner object types: