Skip to content

Commit

Permalink
Docs: Cleanup meta field docs
Browse files Browse the repository at this point in the history
Meta fields were locked down to not allow exotic options to the
underlying field types in elastic#8143. This change fixes the docs
to no longer refer to the old settings.

closes elastic#10879
  • Loading branch information
rjernst committed May 7, 2015
1 parent e7540e9 commit 36e1c64
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 77 deletions.
4 changes: 1 addition & 3 deletions docs/reference/mapping/fields/field-names-field.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[[mapping-field-names-field]]
=== `_field_names`
added[1.3.0]

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.
18 changes: 1 addition & 17 deletions docs/reference/mapping/fields/id-field.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
--------------------------------------------------

9 changes: 0 additions & 9 deletions docs/reference/mapping/fields/routing-field.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@
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.

[float]
==== required

Expand Down
11 changes: 0 additions & 11 deletions docs/reference/mapping/fields/size-field.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,3 @@ the mapping to:
}
}
--------------------------------------------------

In order to also store it, use:

[source,js]
--------------------------------------------------
{
"tweet" : {
"_size" : {"enabled" : true, "store" : true }
}
}
--------------------------------------------------
33 changes: 6 additions & 27 deletions docs/reference/mapping/fields/type-field.asciidoc
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
[[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.
Each document indexed is associated with an id and a type. The `_type`
field allows accessing only the type of a document.

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"}
}
}
--------------------------------------------------
Note, even though the `_type` is not indexed, all the APIs still work
(since they work with the `_uid` field), as well as fetching by type
using `term`, `terms` or `prefix` queries/filters (including the
specific `type` filter).
5 changes: 2 additions & 3 deletions docs/reference/mapping/fields/uid-field.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
6 changes: 2 additions & 4 deletions docs/reference/query-dsl/ids-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
== Ids Query

Filters documents that only have the provided ids. Note, this query
does not require the <<mapping-id-field,_id>>
field to be indexed since it works using the
<<mapping-uid-field,_uid>> field.
uses the <<mapping-uid-field,_uid>> field.

[source,js]
--------------------------------------------------
Expand All @@ -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.
4 changes: 1 addition & 3 deletions docs/reference/query-dsl/type-query.asciidoc
Original file line number Diff line number Diff line change
@@ -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 <<mapping-uid-field,_uid>> field).
Filters documents matching the provided document / mapping type.

[source,js]
--------------------------------------------------
Expand Down

0 comments on commit 36e1c64

Please sign in to comment.