elastic / docs-content

Elastic Documentation Content
Other
0 stars 16 forks source link

[Serverless]: Discover not working properly for sample data (older dates) #101

Open georgewallace opened 1 day ago

georgewallace commented 1 day ago

Serverless Docs

Welcome to Elastic Serverless

Description

The following takes you through my testing of trying to get my example to work

When testing the Aggregations page, I was running the examples using the sample data I used in Get started. This data can be seen in the Resources and additional context section.

In our getting started example we just create an index and add data to the index using the _bulk endpoint. This sets our release_date as our date field. I tried to run the example replacing my-field with page_count' andmy-indexwith books. I got no results. This was because my timestamp fieldrelease_date has old dates from when the books came out.

curl "${ES_URL}/my-index/_search?pretty" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "Content-Type: application/json" \
-d'
{
  "query": {
    "range": {
      "@timestamp": {
        "gte": "now-1d/d",
        "lt": "now/d"
      }
    }
  },
  "aggs": {
    "my-agg-name": {
      "terms": {
        "field": "my-field"
      }
    }
  }
}

Next I decided to discover my data as I wanted to look at it. I got the following view.

Image

Knowing that my data is older than 2015, I tried to use the date filter up top to find my records. The absolute picker only gave me dates back to 2008. Image

I went back to the main page and clicked Search entire time range Image

This now gives me 1925-1939 as options in the Absolute picker.

If I switch to the relative picker, any range that I pick under 25 years gives me an error.

Image

This experience is confusing to a customer trying to discover their data.

Resources and additional context

{ "index" : { "_index" : "books" } }
{"name": "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470}
{ "index" : { "_index" : "books" } }
{"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585}
{ "index" : { "_index" : "books" } }
{"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328}
{ "index" : { "_index" : "books" } }
{"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227}
{ "index" : { "_index" : "books" } }
{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}
{ "index" : { "_index" : "books" } }
{"name": "The Handmaids Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}
georgewallace commented 1 day ago

@KOTungseth This is the example I ran across with the date filters.