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

Comments

Projects
None yet
2 participants
@frli
Copy link

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

This comment has been minimized.

Copy link
Contributor

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 uboness closed this in 7dab7ab Aug 20, 2013

uboness added a commit that referenced this issue Aug 20, 2013

when doing range queries within a query_string query, the range terms…
… should only be lowercased if the field is not numeric

fixes #3540
@frli

This comment has been minimized.

Copy link
Author

commented Aug 20, 2013

Thanks for the quick fix!

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

when doing range queries within a query_string query, the range terms…
… 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
You can’t perform that action at this time.