We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What do you want to do?
Tell us about your request. Provide a summary of the request.
The Date field type documentation states that "the value must be non-negative":
This is incorrect. The only negative value that is not supported is -9223372036854775808 (Long.MIN_VALUE in Java).
-9223372036854775808
Long.MIN_VALUE
Version: List the OpenSearch version to which this issue applies, e.g. 2.14, 2.12--2.14, or all.
all
What other resources are available? Provide links to related issues, POCs, steps for testing, etc.
First I created an index with a date mapping:
date
curl -X PUT 'http://localhost:9200/date' \ -H 'Content-Type: application/json' \ -d '{ "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 1 } }, "mappings": { "dynamic": "strict", "properties": { "dateField": { "type": "date", "doc_values": true, "store": true } } } }'
I then successfully indexed a document with a negative value:
curl -X PUT 'http://localhost:9200/date/_doc/date-1' \ -H 'Content-Type: application/json' \ -d '{ "dateField": -1, }'
I was able to search for the document using a range query:
curl 'http://localhost:9200/date/_search' \ -H 'Content-Type: application/json' \ -d '{ "query": { "range": { "dateField": { "gte": -1 } } } }'
I was also able to use a date histogram with a time zone:
curl 'http://localhost:9200/date/_search' \ -H 'Content-Type: application/json' \ -d '{ "query": { "match_all": {} }, "size": 0, "aggs": { "will_it_work_for_negative?": { "date_histogram": { "field": "dateField", "calendar_interval": "day", "time_zone": "America/New_York" } } } }'
The text was updated successfully, but these errors were encountered:
Catch All Triage - 1
Sorry, something went wrong.
No branches or pull requests
What do you want to do?
Tell us about your request. Provide a summary of the request.
The Date field type documentation states that "the value must be non-negative":
This is incorrect. The only negative value that is not supported is
-9223372036854775808
(Long.MIN_VALUE
in Java).Version: List the OpenSearch version to which this issue applies, e.g. 2.14, 2.12--2.14, or all.
all
What other resources are available? Provide links to related issues, POCs, steps for testing, etc.
First I created an index with a
date
mapping:I then successfully indexed a document with a negative value:
I was able to search for the document using a range query:
I was also able to use a date histogram with a time zone:
The text was updated successfully, but these errors were encountered: