OpenSearch/docs/reference/mapping/fields
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
..
all-field.asciidoc [DOCS] Multiple doc fixes 2014-03-07 14:24:58 +01:00
analyzer-field.asciidoc [DOCS] Multiple doc fixes 2014-03-07 14:24:58 +01:00
boost-field.asciidoc Reflect that 'field_value_factor' is only in 1.2.x 2014-07-23 15:49:03 +02:00
field-names-field.asciidoc [DOCS] move all coming tags to added in master 2014-07-23 16:37:19 +02:00
id-field.asciidoc [DOCS] Changed all store:yes/no to store:true/false 2013-11-07 16:57:18 +01:00
index-field.asciidoc Migrated documentation into the main repo 2013-08-29 01:24:34 +02:00
parent-field.asciidoc Migrated documentation into the main repo 2013-08-29 01:24:34 +02:00
routing-field.asciidoc [DOCS] Changed all store:yes/no to store:true/false 2013-11-07 16:57:18 +01:00
size-field.asciidoc [DOCS] Changed all store:yes/no to store:true/false 2013-11-07 16:57:18 +01:00
source-field.asciidoc Add more anchor links to documentation 2013-09-30 13:13:16 -06:00
timestamp-field.asciidoc Generate timestamp when path is null 2014-07-31 19:48:22 +02:00
ttl-field.asciidoc [DOCS] Changed all store:yes/no to store:true/false 2013-11-07 16:57:18 +01:00
type-field.asciidoc [DOCS] `_type` instead of Type Field 2014-03-27 08:35:15 +01:00
uid-field.asciidoc Migrated documentation into the main repo 2013-08-29 01:24:34 +02:00