|
@@ -1,31 +1,7 @@
|
|
|
[[mapping-type-field]]
|
|
|
=== `_type`
|
|
|
|
|
|
-Each document indexed is associated with an id and a type. The type,
|
|
|
-when indexing, is automatically indexed into a `_type` field. By
|
|
|
-default, the `_type` field is indexed (but *not* analyzed) and not
|
|
|
-stored. This means that the `_type` field can be queried.
|
|
|
-
|
|
|
-The `_type` field can be stored as well, for example:
|
|
|
-
|
|
|
-[source,js]
|
|
|
---------------------------------------------------
|
|
|
-{
|
|
|
- "tweet" : {
|
|
|
- "_type" : {"store" : true}
|
|
|
- }
|
|
|
-}
|
|
|
---------------------------------------------------
|
|
|
-
|
|
|
-The `_type` field can also not be indexed, and all the APIs will still
|
|
|
-work except for specific queries (term queries / filters) or aggregations
|
|
|
-done on the `_type` field.
|
|
|
-
|
|
|
-[source,js]
|
|
|
---------------------------------------------------
|
|
|
-{
|
|
|
- "tweet" : {
|
|
|
- "_type" : {"index" : "no"}
|
|
|
- }
|
|
|
-}
|
|
|
---------------------------------------------------
|
|
|
+Each document indexed is associated with an id and a type. The `_type`
|
|
|
+field allows accessing only the type of a document. It is indexed
|
|
|
+to allow quickly filtering on type, for example, when performing
|
|
|
+a search request on a single or multiple types.
|