Skip to content

Dates and epoch_millis as floats #14641

@royrusso

Description

@royrusso

Attempting to migrate to 2.x, I've encountered a strange problem with range filters not able to match any of the mappings I try holding epoch_millis. Maybe related to #10971

Given a document with a time_stamp field in the mapping:

          "time_stamp": {
            "type": "date",
            "format": "epoch_millis"
          }

With some data:

station: "ASN00033312",
precip_tenths_mm: 2,
time_stamp: 1390712400000,
location: {
lat: -23.2233,
lon: 150.605
}

I would expect the following to match:

"query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "range": {
                "time_stamp": {
             "gte": 1390712400000,
             "format" : "epoch_millis"
                }
            }
            }
          ]
        }
      }
    }
  }

The above returns no document, even though there are thousands that should respond. Removing the format at query time, doesn't help. Mapping the time_stamp field as format "basic_date", as I had in 1.x, doesn't seem to return anything either.

Bug? Pebcak?

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions