From e29492ce94f6aeea92a8d8c7e672044667c2061e Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 30 Apr 2015 15:01:35 -0700 Subject: [PATCH] Docs: Cleanup meta field docs Meta fields were locked down to not allow exotic options to the underlying field types in #8143. This change fixes the docs to no longer refer to the old settings. closes #10879 --- .../mapping/fields/field-names-field.asciidoc | 3 -- .../mapping/fields/id-field.asciidoc | 18 +---------- .../mapping/fields/routing-field.asciidoc | 15 ++------- .../mapping/fields/size-field.asciidoc | 11 ------- .../mapping/fields/type-field.asciidoc | 32 +++---------------- .../mapping/fields/uid-field.asciidoc | 5 ++- docs/reference/query-dsl/ids-query.asciidoc | 6 ++-- docs/reference/query-dsl/type-query.asciidoc | 4 +-- 8 files changed, 12 insertions(+), 82 deletions(-) diff --git a/docs/reference/mapping/fields/field-names-field.asciidoc b/docs/reference/mapping/fields/field-names-field.asciidoc index 5a1653747a987..4f3e4a2b3fb87 100644 --- a/docs/reference/mapping/fields/field-names-field.asciidoc +++ b/docs/reference/mapping/fields/field-names-field.asciidoc @@ -4,6 +4,3 @@ The `_field_names` field indexes the field names of a document, which can later be used to search for documents based on the fields that they contain typically using the `exists` and `missing` filters. - -`_field_names` is indexed by default for indices that have been created after -Elasticsearch 1.3.0. diff --git a/docs/reference/mapping/fields/id-field.asciidoc b/docs/reference/mapping/fields/id-field.asciidoc index 856b67bb9c9b5..8150a13afe5fe 100644 --- a/docs/reference/mapping/fields/id-field.asciidoc +++ b/docs/reference/mapping/fields/id-field.asciidoc @@ -2,26 +2,10 @@ === `_id` Each document indexed is associated with an id and a type. The `_id` -field can be used to index just the id, and possible also store it. By -default it is not indexed and not stored (thus, not created). +field allows accessing only the id of a document. Note, even though the `_id` is not indexed, all the APIs still work (since they work with the `_uid` field), as well as fetching by ids using `term`, `terms` or `prefix` queries/filters (including the specific `ids` query/filter). -The `_id` field can be enabled to be indexed, and possibly stored, -using the appropriate mapping attributes: - -[source,js] --------------------------------------------------- -{ - "tweet" : { - "_id" : { - "index" : "not_analyzed", - "store" : true - } - } -} --------------------------------------------------- - diff --git a/docs/reference/mapping/fields/routing-field.asciidoc b/docs/reference/mapping/fields/routing-field.asciidoc index 1c0372c792d6f..37b173e5aa365 100644 --- a/docs/reference/mapping/fields/routing-field.asciidoc +++ b/docs/reference/mapping/fields/routing-field.asciidoc @@ -2,16 +2,7 @@ === `_routing` The routing field allows to control the `_routing` aspect when indexing -data and explicit routing control is required. - -[float] -==== store / index - -The first thing the `_routing` mapping does is to store the routing -value provided (`store` set to `true`) and index it (`index` set to -`not_analyzed`). The reason why the routing is stored by default is so -reindexing data will be possible if the routing value is completely -external and not part of the docs. +data and explicit routing control is required. It is stored and indexed. [float] ==== required @@ -20,9 +11,7 @@ Another aspect of the `_routing` mapping is the ability to define it as required by setting `required` to `true`. This is very important to set when using routing features, as it allows different APIs to make use of it. For example, an index operation will be rejected if no routing value -has been provided (or derived from the doc). A delete operation will be -broadcasted to all shards if no routing value is provided and `_routing` -is required. +has been provided. [float] ==== id uniqueness diff --git a/docs/reference/mapping/fields/size-field.asciidoc b/docs/reference/mapping/fields/size-field.asciidoc index 7abfd401f8f7b..9b35693bf15da 100644 --- a/docs/reference/mapping/fields/size-field.asciidoc +++ b/docs/reference/mapping/fields/size-field.asciidoc @@ -13,14 +13,3 @@ the mapping to: } } -------------------------------------------------- - -In order to also store it, use: - -[source,js] --------------------------------------------------- -{ - "tweet" : { - "_size" : {"enabled" : true, "store" : true } - } -} --------------------------------------------------- diff --git a/docs/reference/mapping/fields/type-field.asciidoc b/docs/reference/mapping/fields/type-field.asciidoc index 7986e8bf883d2..52521d4c25e1f 100644 --- a/docs/reference/mapping/fields/type-field.asciidoc +++ b/docs/reference/mapping/fields/type-field.asciidoc @@ -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. diff --git a/docs/reference/mapping/fields/uid-field.asciidoc b/docs/reference/mapping/fields/uid-field.asciidoc index f9ce245adc89a..2bd0acd54864a 100644 --- a/docs/reference/mapping/fields/uid-field.asciidoc +++ b/docs/reference/mapping/fields/uid-field.asciidoc @@ -6,6 +6,5 @@ Each document indexed is associated with an id and a type, the internal is composed of the type and the id (meaning that different types can have the same id and still maintain uniqueness). -The `_uid` field is automatically used when `_type` is not indexed to -perform type based filtering, and does not require the `_id` to be -indexed. +The `_uid` field is for type based filtering, as well as for +lookups of `_id` and `_type`. diff --git a/docs/reference/query-dsl/ids-query.asciidoc b/docs/reference/query-dsl/ids-query.asciidoc index e5f1441f3170f..8811b8fa76790 100644 --- a/docs/reference/query-dsl/ids-query.asciidoc +++ b/docs/reference/query-dsl/ids-query.asciidoc @@ -2,9 +2,7 @@ == Ids Query Filters documents that only have the provided ids. Note, this query -does not require the <> -field to be indexed since it works using the -<> field. +uses the <> field. [source,js] -------------------------------------------------- @@ -17,4 +15,4 @@ field to be indexed since it works using the -------------------------------------------------- The `type` is optional and can be omitted, and can also accept an array -of values. +of values. If no type is specified, all types defined in the index mapping are tried. diff --git a/docs/reference/query-dsl/type-query.asciidoc b/docs/reference/query-dsl/type-query.asciidoc index d4047f38a0c9b..3aa932e56702c 100644 --- a/docs/reference/query-dsl/type-query.asciidoc +++ b/docs/reference/query-dsl/type-query.asciidoc @@ -1,9 +1,7 @@ [[query-dsl-type-query]] == Type Query -Filters documents matching the provided document / mapping type. Note, -this query can work even when the `_type` field is not indexed (using -the <> field). +Filters documents matching the provided document / mapping type. [source,js] --------------------------------------------------