Free and Open, Distributed, RESTful Search Engine
Find a file
Luca Belluccini 2d3bcc483d
[DOCS] Warn only one date format is added to the field date formats when using dynamic_date_formats (#88915)
* [DOCS] Warn only one date format is added to the field date formats

When using multiple options in `dynamic_date_formats`, only one of the formats of the first document having a date matching one of the date formats provided will be used.

E.g.
```
PUT my-index-000001
{
  "mappings": {
    "dynamic_date_formats": [ "yyyy/MM", "MM/dd/yyyy"]
  }
}

PUT my-index-000001/_doc/1
{
  "create_date": "09/25/2015"
}
```

The generated mappings will be:
```
    "mappings": {
      "dynamic_date_formats": [
        "yyyy/MM",
        "MM/dd/yyyy"
      ],
      "properties": {
        "create_date": {
          "type": "date",
          "format": "MM/dd/yyyy"
        }
      }
    },
```

Indexing a document with `2015/12` would lead to the `format` `"yyyy/MM"` being used for the `create_date`.

This can be misleading especially if the user is using multiple date formats on the same field.
The first document will determine the format of the `date` field being detected.

Maybe we should provide an additional example, such as:
```
PUT my-index-000001
{
  "mappings": {
    "dynamic_date_formats": [ "yyyy/MM||MM/dd/yyyy"]
  }
}
```

My wording is not great, so feel free to amend/edit.

* Update docs/reference/mapping/dynamic/field-mapping.asciidoc

Reword and add code example

* Turned discussion of the two syntaxes into an admonition

* Fix failing tests

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2022-08-11 10:43:53 +02:00
.ci Downgrade known bad containerd version during packaging tests (#89255) 2022-08-11 10:00:05 +09:30
.github Update CODEOWNERS (#89155) 2022-08-09 15:54:35 +02:00
.idea Stop versioning Checkstyle IDE config (#87285) 2022-06-02 08:58:11 +01:00
benchmarks Remove calls to deprecated xcontent method (#84733) 2022-08-01 22:18:03 +09:30
build-conventions Add Checkstyle rule for broken switch cases (#88739) 2022-07-27 09:22:06 +01:00
build-tools Add file delete retry to testcluster ElasticsearchNode (#89095) 2022-08-07 11:16:49 +01:00
build-tools-internal Upgrade Apache Commons Logging to 1.2 (#85745) 2022-08-10 13:19:15 -04:00
ccr/images [DOCS] Update remote cluster docs (#77043) 2021-09-22 16:02:33 -04:00
client Upgrade Apache Commons Logging to 1.2 (#85745) 2022-08-10 13:19:15 -04:00
dev-tools Improve atomic push script to support worktrees (#68873) 2021-02-11 10:13:15 -08:00
distribution Ensure APM module is always installed in release test clusters (#89223) 2022-08-10 09:04:40 -07:00
docs [DOCS] Warn only one date format is added to the field date formats when using dynamic_date_formats (#88915) 2022-08-11 10:43:53 +02:00
gradle Upgrade Apache Commons Logging to 1.2 (#85745) 2022-08-10 13:19:15 -04:00
libs Add publishing plugin to elasticsearch-grok project (#89184) 2022-08-09 08:02:08 +09:30
licenses Keep low level rest client under Apache 2 software license (#68694) 2021-02-08 11:13:31 -08:00
modules Script: Common base class for write scripts (#89141) 2022-08-09 12:31:18 -05:00
plugins Upgrade Apache Commons Logging to 1.2 (#85745) 2022-08-10 13:19:15 -04:00
qa Ensure APM module is always installed in release test clusters (#89223) 2022-08-10 09:04:40 -07:00
rest-api-spec User Profile - GetProfile API nows supports multiple UIDs (#89023) 2022-08-10 10:51:38 +09:30
server Fix message for stalled shutdown (#89254) 2022-08-11 07:48:03 +01:00
test Upgrade Apache Commons Logging to 1.2 (#85745) 2022-08-10 13:19:15 -04:00
x-pack Fix message for stalled shutdown (#89254) 2022-08-11 07:48:03 +01:00
.backportrc.json Ensure order of precedence in matching main branch in backports 2022-07-27 13:09:28 -07:00
.dir-locals.el Go back to 140 column limit in .dir-locals.el 2017-04-14 08:50:53 -06:00
.editorconfig SQL: Fix FORMAT function to better comply with Microsoft SQL Server specification (#86225) 2022-05-18 12:03:00 +02:00
.git-blame-ignore-revs Fix typo in instructions for ignore-revs (#80058) 2021-11-04 12:10:55 +11:00
.gitattributes Assert no carriage returns in release notes test samples (#77238) 2021-09-07 20:45:23 +01:00
.gitignore Stop versioning Checkstyle IDE config (#87285) 2022-06-02 08:58:11 +01:00
build.gradle Update version serialization for CCR backport and re-enable BWC tests (#88998) 2022-08-02 03:38:31 +09:30
BUILDING.md Add verification metadata for dependencies (#88814) 2022-08-04 09:51:16 +02:00
CHANGELOG.md In the field capabilities API, re-add support for fields in the request body (#88972) 2022-08-04 13:44:50 -04:00
CONTRIBUTING.md Update references to master branch in developer documentation 2022-07-25 10:59:08 -07:00
gradle.properties Add verification metadata for dependencies (#88814) 2022-08-04 09:51:16 +02:00
gradlew Update to to Gradle wrapper 7.5 (#85141) 2022-07-19 08:12:19 +02:00
gradlew.bat Update to to Gradle wrapper 7.5 (#85141) 2022-07-19 08:12:19 +02:00
LICENSE.txt Update sources with new SSPL+Elastic-2.0 license headers 2021-02-02 16:10:53 -08:00
NOTICE.txt Remove Joda dependency (#79007) 2021-10-13 17:37:31 -07:00
README.asciidoc [DOCS] Refactor quick start guide and README (#71331) 2021-04-20 09:32:21 -04:00
REST_API_COMPATIBILITY.md Update references to master branch in developer documentation 2022-07-25 10:59:08 -07:00
settings.gradle Remove duplicate definition of checkstyle version in use (#88339) 2022-07-15 19:31:50 +02:00
TESTING.asciidoc Update references to master branch in developer documentation 2022-07-25 10:59:08 -07:00
TRACING.md Fix typo in TRACING.md 2022-08-08 09:28:44 +01:00
Vagrantfile Introduce ES_JAVA_HOME (#68954) 2021-02-17 12:41:23 -05:00

= Elasticsearch

Elasticsearch is the distributed, RESTful search and analytics engine at the
heart of the https://www.elastic.co/products[Elastic Stack]. You can use
Elasticsearch to store, search, and manage data for:

* Logs
* Metrics
* A search backend
* Application monitoring
* Endpoint security

\... and more!

To learn more about Elasticsearch's features and capabilities, see our
https://www.elastic.co/products/elasticsearch[product page].

[[get-started]]
== Get started

The simplest way to set up Elasticsearch is to create a managed deployment with
https://www.elastic.co/cloud/as-a-service[Elasticsearch Service on Elastic
Cloud].

If you prefer to install and manage Elasticsearch yourself, you can download
the latest version from 
https://www.elastic.co/downloads/elasticsearch[elastic.co/downloads/elasticsearch].

For more installation options, see the
https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html[Elasticsearch installation
documentation].

[[upgrade]]
== Upgrade

To upgrade from an earlier version of Elasticsearch, see the
https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html[Elasticsearch upgrade
documentation].

[[build-source]]
== Build from source

Elasticsearch uses https://gradle.org[Gradle] for its build system.

To build a distribution for your local OS and print its output location upon
completion, run:
----
./gradlew localDistro
----

To build a distribution for another platform, run the related command:
----
./gradlew :distribution:archives:linux-tar:assemble
./gradlew :distribution:archives:darwin-tar:assemble
./gradlew :distribution:archives:windows-zip:assemble
----

To build distributions for all supported platforms, run:
----
./gradlew assemble
----

Distributions are output to `distributions/archives`.

To run the test suite, see xref:TESTING.asciidoc[TESTING].

[[docs]]
== Documentation

For the complete Elasticsearch documentation visit
https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html[elastic.co].

For information about our documentation processes, see the
xref:docs/README.asciidoc[docs README].

[[contribute]]
== Contribute

For contribution guidelines, see xref:CONTRIBUTING.md[CONTRIBUTING]. 

[[questions]]
== Questions? Problems? Suggestions?

* To report a bug or request a feature, create a
https://github.com/elastic/elasticsearch/issues/new/choose[GitHub Issue]. Please
ensure someone else hasn't created an issue for the same topic.

* Need help using Elasticsearch? Reach out on the
https://discuss.elastic.co[Elastic Forum] or https://ela.st/slack[Slack]. A
fellow community member or Elastic engineer will be happy to help you out.