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

Date math not working correctly due to lower casing #3540

Closed
frli opened this issue Aug 20, 2013 · 2 comments
Closed

Date math not working correctly due to lower casing #3540

frli opened this issue Aug 20, 2013 · 2 comments

Comments

@frli
Copy link

frli commented Aug 20, 2013

ES 0.90.3 appears to lowercase the date math portion of this query, turning M (month) into m (minutes). The same query is correctly interpreted in ES 0.20.6:

{ 
    "query" : { "query_string" : { "default_operator" : "AND",
          "query" : "created:[now-1M/d TO now/d]"
        } },
  "sort" : [ { "ordernumber" : "desc" } ]
}

The following query with upper case D for day rounding generates an exception in ES 0.20.6 but not on 0.90.3 which further indicates that some lower casing is going on.

{ 
    "query" : { "query_string" : { "default_operator" : "AND",
          "query" : "created:[now-1M/D TO now/D]"
        } },
  "sort" : [ { "ordernumber" : "desc" } ]
}
@uboness
Copy link
Contributor

uboness commented Aug 20, 2013

yeah... the range queries are lowercased in the query string... for range queries it makes sense to leave the terms as they are (without lowercasing)... will fix that. Thanks!

uboness added a commit that referenced this issue Aug 20, 2013
… should only be lowercased if the field is not numeric

fixes #3540
@frli
Copy link
Author

frli commented Aug 20, 2013

Thanks for the quick fix!

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
… should only be lowercased if the field is not numeric

fixes elastic#3540
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants