Skip to content

Date Math incorrectly returns documents outside the range #40581

Closed
@cawoodm

Description

@cawoodm

ELK 6.6.1 Windows

When querying docs for yesterday(>= now-1d/d AND < now/d), docs for today are returned.

GET /myindex/_search?sort=timestamp:desc
{
  "from" : 0, "size" : 100,
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "timestamp": {
                "gte": "now-1d/d",
                "lt": "now/d"
            }
          }
        }
      ]
    }
  }
}

A document of timestamp today 00:23:57.084 (CET) is returned:

   "_id": "Z4d3wWkBV0vWSMeR5iew",
   "_source": {
      "timestamp": "2019-03-27T23:23:57.084Z",
   ...

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search/SearchSearch-related issues that do not fall into other categoriesfeedback_needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions