Skip to content

generate timestamp when path is null #4718

@khoan

Description

@khoan

Shouldn't timestamp be generated when value of path is null ?

Mapping definition:

curl -X PUT  http://localhost:9200/twitter/ -d '{
    "mappings": {
        "_default_": {
            "_timestamp" : {
                "enabled" : "yes",
                "store": "yes",
                "path" : "post_date"
            },
            "properties": {
                "message": {
                    "type": "string"
                }
            }
        }
    }
}'

Get error when:

curl -X PUT http://127.0.0.1:9200/twitter/tweet/123 -d '{
  message: "bam bam"
}'

=>  {"error":"ElasticSearchParseException[failed to parse doc to extract routing/timestamp]; nested: TimestampParsingException[failed to parse timestamp [null]]; ","status":400}

curl -X PUT http://127.0.0.1:9200/twitter/tweet/123 -d '{
  message: "bam bam",
  post_date: "2009-11-15T14:12:12Z"
}'

=> {"ok":true,"_index":"twitter","_type":"tweet","_id":"123","_version":1}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions