Date Range "suddenly" returns no results


#1

Hi,

I'm using a date range to get objects of type Partner based on their age, allowing users to select from a dropdown the ranges like "Younger than 30", "From 30 to 45", "From 45 to 59", "From 59 to 65", "Older than 65". Every range is working except the 45-59 range, which returns no elements at all.

Simplifying everything, I came down to query like:

{
  "query": {
    "filtered": {
      "query": {
       "match_all":{}
      },
      "filter": {
            "range": {
              "PARTNER.BirthDate": {
                "from": "-294000000000",
                "to": "-293000000000"
              }
            }
       
      }
    }
  }
}

Verbalizing in actual dates, I'm searching for people born from Sep 07th 1960 to Sep 18th. That query returns just fine (800 records).

If I increase the upper value, to -292000000000 (Sep 30th), I'm increasing the filteres interval. Hence, I'm expecting to get more results. Instead, I get 0 zero results.

The behaviour is the same using "lte/gte", and I'm executing the query on the web console (although the problem is also ocurring via the JAVA API).

If I search [-314000000000; -312000000000] or [-94000000000; -92000000000], everything OK. If the filter is [-114000000000;-112000000000] or [-214000000000, -212000000000], I get no results. If I search the same dates with yyyy-mm-dd pattern (from "1963-03-22" to "1963-04-14", for the last example), I get the expected values.

Any ideas on this problem ?

Thanks


(system) #2