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

Dates: Fixed parsing issue with exact dates when using lte. #8834

Closed
wants to merge 3 commits into from

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Dec 8, 2014

Date parsing uses a flag to indicate whether the rounding should be
inclusive or exclusive. This change fixes the parsing to not use this
logic in the case of exact dates that do not have rounding syntax.

closes #8490

Date parsing uses a flag to indicate whether the rounding should be
inclusive or exclusive.  This change fixes the parsing to not use this
logic in the case of exact dates that do not have rounding syntax.

closes elastic#8490
public void testRoundingDoesNotAffectExactDate() {
assertDateMathEquals("2014", "2014-01-01T00:00:00.000", 0, true, null);
assertDateMathEquals("2014", "2014-01-01T00:00:00.000", 0, false, null);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, but I get three test failures when I run the full suite:

Tests with failures:
  - org.elasticsearch.search.simple.SimpleSearchTests.simpleDateRangeWithUpperInclusiveEnabledTests
  - org.elasticsearch.index.mapper.date.SimpleDateMappingTests.testDayWithoutYearFormat
  - org.elasticsearch.index.mapper.date.SimpleDateMappingTests.testHourFormat

also, should we have the example from the original issue as test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I just fixed those test failures. I will change this test to use the date from the original issue.

@rjernst
Copy link
Member Author

rjernst commented Dec 9, 2014

Thanks @brwe I pushed changes addressing your comments.

@rjernst
Copy link
Member Author

rjernst commented Dec 9, 2014

I'm closing this since it can be accomplished in 1.x by disabling mapping.date.round_ceil and will work on the fix for #8598 to remove the setting altogether.

@rjernst rjernst closed this Dec 9, 2014
@rjernst rjernst deleted the fix/8490 branch January 21, 2015 23:22
@clintongormley clintongormley added :Search/Mapping Index mappings, including merging and defining field types and removed :Dates labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Mapping Index mappings, including merging and defining field types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date Range Filter unclear rounding behavior
3 participants