Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Add examples to the mapping docs #45520

Merged
merged 5 commits into from
Aug 19, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions docs/reference/indices/put-mapping.asciidoc
Original file line number Diff line number Diff line change
@@ -57,12 +57,23 @@ PUT /twitter-1,twitter-2/_mapping <1>
[float]
==== Updating field mappings

In general, the mapping for existing fields cannot be updated. There are some
exceptions to this rule. For instance:
// tag::put-field-mapping-exceptions

* new <<properties>> can be added to <<object>> fields.
* new <<multi-fields,multi-fields>> can be added to existing fields.
* the <<ignore-above>> parameter can be updated.
You can't change the mapping of an existing field, with the following
exceptions:

* You can add new <<properties,properties>> to an <<object,`object`>> field.
* You can use the <<multi-fields,`field`>> mapping parameter to enable
multi-fields.
* You can change the value of the <<ignore-above,`ignore_above`>> mapping
parameter.

Changing the mapping of an existing field could invalidate data that's already
indexed. If you need to change the mapping of a field, create a new index with
the correct mappings and <<docs-reindex,reindex>> your data into that index. If
you only want to rename a field, consider adding an <<alias, `alias`>> field.

// end::field-mapping-exceptions

For example:

16 changes: 2 additions & 14 deletions docs/reference/mapping.asciidoc
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ with an explicit mapping.

[source,js]
----
PUT my-index
PUT /my-index
{
"mappings": {
"properties": {
@@ -177,19 +177,7 @@ PUT /my-index/_mapping
[[update-mapping]]
=== Update the mapping of a field

You can't change the mapping of an existing field, with the following
exceptions:

* You can add new <<properties,properties>> to an <<object,`object`>> field.
* You can use the <<multi-fields,`field`>> mapping parameter to enable
multi-fields.
* You can change the value of the <<ignore-above,`ignore_above`>> mapping
parameter.

Changing the mapping of an existing field could invalidate data that's already
indexed. If you need to change the mapping of a field, create a new index with
the correct mappings and <<docs-reindex,reindex>> your data into that index. If
you only want to rename a field, consider adding an <<alias, `alias`>> field.
include::docs/reference/indices/put-mapping.asciidoc[tag=put-field-mapping-exceptions]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtibshirani This includes the content tagged in put-mapping.asciidoc.

Let me know what you think. If you'd prefer, I also just point users to the Put Mapping API docs. Thanks again for your input!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, this works for me. Tagged regions seem like a really nice feature, I'll keep them in mind for future situations where there's duplicated content.


[float]
[[view-mapping]]