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

Mapping: Explicit _timestamp default null is set to now #9428

Merged
merged 1 commit into from Jan 26, 2015

Conversation

dadoonet
Copy link
Member

When creating an index with:

PUT new_index
{
    "mappings": {
        "power": {
            "_timestamp" : {
                "enabled" : true,
                "default": null
            }
        }
    }
}

When restarting the cluster, now is applied instead of null. So index become:

{
    "mappings": {
        "power": {
            "_timestamp" : {
                "enabled" : true,
                "default": "now"
            }
        }
    }
}

This PR fix that and applies null when it was explicitly set.

Note that this won't happen anymore in 1.5 as null is not allowed anymore as a default value. See #9104.

See also:

When creating an index with:

```
PUT new_index
{
    "mappings": {
        "power": {
            "_timestamp" : {
                "enabled" : true,
                "default": null
            }
        }
    }
}
```

When restarting the cluster, `now` is applied instead of `null`. So index become:

```
{
    "mappings": {
        "power": {
            "_timestamp" : {
                "enabled" : true,
                "default": "now"
            }
        }
    }
}
```

This PR fix that and applies `null` when it was explicitly set.

Note that this won't happen anymore in 1.5 as `null` is not allowed anymore as a `default` value. See elastic#9104.

See also:

* elastic#7036
* elastic#9049
* elastic#9426#issuecomment-71534871
@dadoonet dadoonet added :Search/Mapping Index mappings, including merging and defining field types review v1.4.3 labels Jan 26, 2015
@dadoonet dadoonet self-assigned this Jan 26, 2015
@rjernst
Copy link
Member

rjernst commented Jan 26, 2015

LGTM.

@rjernst rjernst removed the review label Jan 26, 2015
@dadoonet dadoonet merged commit b95fcd6 into elastic:1.4 Jan 26, 2015
@dadoonet dadoonet deleted the pr/timestamp-null-set-now branch January 26, 2015 21:43
@clintongormley clintongormley changed the title Explicit _timestamp default null is set to now Mapping: Explicit _timestamp default null is set to now Feb 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug >regression :Search/Mapping Index mappings, including merging and defining field types v1.4.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants