Trying to understand query_string_query behavior change


(Richard) #1

Hello all,
I'm in the process of upgrading from 5.5 to 6.3, using the AWS ElasticSearchService. I've run into a behavior change between the two, and while I understand the underlying reason, I'm unsure as to why the behavior changed.

Essentially, I have a 'long' field that stores a timestamp. When using the fields parameter with the query_string_query in 5.5 I'm able to query the field as a string, no problem:

PUT test
{
  "mappings": {
    "asset": {
      "properties": {
        "timestamp": {
          "type": "long"
        },
        "title": {
          "type": "text"
        }
      }
    }
  }
}

PUT test/asset/1
{
    "timestamp": 1540515639,
    "title": "A title"
}

GET test/_search
{
  "query": {
    "query_string": {
      "fields": [
        "timestamp"
        ], 
      "query": ">1540515638"
    }
  }
}

The query returns the correct result in 5.5
However, in 6.3 I get:

"type": "number_format_exception",
"reason": "For input string: \">1540515638\""

I can certainly make the query work by using a field prefix, and not using the 'fields' parameter. But this is part of a larger search application, and that's not a great solution for me.
I'm hypothesizing that this is due to the disappearance of the _all field in some way, but I'm having trouble understanding what changed. Any thoughts?

Thanks,
Richard


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.