mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fixes: #145855 `Time field` in rule update/create forms shows only the fields with `date` data type. This PR adds `date_nanos` type as well. ## To verify: - Create an index that has fields with `date` and `date_nanos` types. ``` PUT test-index-date { "mappings": { "properties": { "date": { "type": "date" }, "timestamp": { "type": "date_nanos" } } } } ``` - Add data with `date` and `date_nanos` data types Note: You can use https://www.site24x7.com/tools/time-stamp-converter.html address to generate date_nanos timestamps with a date you desired. ``` PUT test-index-date/_bulk?refresh { "index" : { "_id" : "1" } } { "date": "2023-02-15T18:00:00.000Z", "timestamp": 1676480400000} { "index" : { "_id" : "2" } } { "date": "2023-02-15T18:00:00.000Z", "timestamp": 1676480400000 } ``` - Open a Rule create form and select `Elasticsearch query` - Select `Query DSL` - Click on `select an index` - Type the above index name (test-index-date) in `Indices to query` input - Select `timestamp` from time field - Click on `Test Query` button and expect to see `Query matched 2 documents in the last 5m.` |
||
---|---|---|
.. | ||
build_sorted_events_query.test.ts | ||
build_sorted_events_query.ts | ||
comparator.test.ts | ||
comparator.ts | ||
comparator_types.ts | ||
constants.ts | ||
index.ts |