OpenSearch/docs/reference
David Pilato 85eb0ea0e7 Generate timestamp when path is null
Index process fails when having `_timestamp` enabled and `path` option is set.
It fails with a `TimestampParsingException[failed to parse timestamp [null]]` message.

Reproduction:

```
DELETE test
PUT  test
{
    "mappings": {
        "test": {
            "_timestamp" : {
                "enabled" : "yes",
                "path" : "post_date"
            }
        }
    }
}
PUT test/test/1
{
  "foo": "bar"
}
```

You can define a default value for when timestamp is not provided
within the index request or in the `_source` document.

By default, the default value is `now` which means the date the document was processed by the indexing chain.

You can disable that default value by setting `default` to `null`. It means that `timestamp` is mandatory:

```
{
    "tweet" : {
        "_timestamp" : {
            "enabled" : true,
            "default" : null
        }
    }
}
```

If you don't provide any timestamp value, indexation will fail.

You can also set the default value to any date respecting timestamp format:

```
{
    "tweet" : {
        "_timestamp" : {
            "enabled" : true,
            "format" : "YYYY-MM-dd",
            "default" : "1970-01-01"
        }
    }
}
```

If you don't provide any timestamp value, indexation will fail.

Closes #4718.
Closes #7036.
2014-07-31 19:48:22 +02:00
..
analysis Docs: Fix syntax on lang-analyzer 2014-07-30 20:17:27 +02:00
cat Docs: Made current version, branch and jdk into asciidoc attributes 2014-07-23 11:55:35 +02:00
cluster Docs: Made current version, branch and jdk into asciidoc attributes 2014-07-23 11:55:35 +02:00
docs Term Vectors API: adds support for wildcards in selected fields 2014-07-30 17:44:37 +02:00
images [doc] Correct decay function equations in function_score description 2014-07-23 17:33:22 +02:00
index-modules Update translog.asciidoc 2014-07-31 14:06:24 +02:00
indices Add `wait_if_ongoing` option to _flush requests 2014-07-24 15:34:53 +02:00
mapping Generate timestamp when path is null 2014-07-31 19:48:22 +02:00
migration [DOCS] Included the `_percolator` index breaking change to migration docs. 2014-02-20 16:43:06 +01:00
modules Docs: Fix typo in scripting.asciidoc 2014-07-29 12:30:09 +02:00
query-dsl Update nested-query.asciidoc 2014-07-26 22:32:28 +02:00
search _geo_distance sort: allow many to many geo point distance 2014-07-31 17:33:45 +02:00
setup Docs: Changing ES_MAX_MEM default from '1gb' to '1g' 2014-07-25 12:50:59 +02:00
testing [TEST] Randomized number of shards used for indices created during tests 2014-03-10 13:01:52 +01:00
analysis.asciidoc Add more anchor links to documentation 2013-09-30 13:13:16 -06:00
api-conventions.asciidoc Disable JSONP by default 2014-07-09 21:17:17 +02:00
cat.asciidoc [DOCS] reordered cat apis menu 2014-06-03 11:06:35 +02:00
cluster.asciidoc [DOCS] Fix HTTP endpoints after stats API changes 2014-01-09 11:30:28 +01:00
docs.asciidoc [DOCS] Moved termvector and mtermvectors from search to docs 2014-01-22 14:10:26 +01:00
getting-started.asciidoc Docs: Made current version, branch and jdk into asciidoc attributes 2014-07-23 11:55:35 +02:00
glossary.asciidoc Migrated documentation into the main repo 2013-08-29 01:24:34 +02:00
index-modules.asciidoc Removed 0.90.* deprecation and addition notifications 2014-02-07 20:52:49 +01:00
index.asciidoc Docs: Made current version, branch and jdk into asciidoc attributes 2014-07-23 11:55:35 +02:00
indices.asciidoc [DOCS] Removed leftover indices status link 2014-04-28 11:39:12 +02:00
mapping.asciidoc Mappings: Add transform to document before index. 2014-07-15 18:40:46 +02:00
modules.asciidoc [DOCS] Fixed link to tribe.asciidoc 2014-01-13 22:01:12 +01:00
query-dsl.asciidoc Migrated documentation into the main repo 2013-08-29 01:24:34 +02:00
search.asciidoc Docs: Fixed path to search-shards 2014-07-26 15:05:53 +02:00
setup.asciidoc [DOCS] Java 7 is required since 1.2.0 2014-05-30 10:45:22 +02:00
testing.asciidoc [DOCS] Test framework documentation 2013-12-02 18:01:45 +01:00