## Summary
Closes: https://github.com/elastic/kibana/issues/169622
Field caps request caching - implement `stale-while-revalidate` cache
headers and etags with 304 responses as appropriate.
This PR accomplishes
- Adds 304 Not Modified to http server
- Adds refresh button to data view management that force refreshes field
list
- Adds `/internal/data_views/fields` endpoint which supports caching.
- This is necessary since `fields_for_wildcard` doesn't support caching
due to POST requests
- Adds `stale-while-revalidate` header directive UNLESS field list is
empty.
- Uses Vary header with hash of user id to force requests when user has
changed.
- Unchanged field list responses won't recreate data view field list
### How to test
1. Pop open the dev tools to the network tab and make sure 'Disable
cache' is unchecked. filter for 'fields' requests
2. Load more than one data set (sample data is fine)
3. Go to discover
4. Switch selected data views. Notice status code on first load vs
subsequent loads
5. Open a new window, notice loading from cache
6. Push document that changes field list. You'll need to wait for cache
to expire for it to load. The default is 5s.
7. Notice that field list loads after cache is old properly result in
304 response.
8. Set `data_views:cache_max_age`, shift reload. No field requests will
be cached.
#### Note on Safari
Safari doesn't support the `stale-while-revalidate` directive.
Additionally, the Safari dev console shows 304 responses as 200's. I
figured this out by adding console statements to the fields endpoint. As
best I can tell, Safari won't be performant on slow clusters but its
also no slower than it was before this PR. Safari does respect the
disabling of cache headers.
## Release note
Data View field list requests are now cached with a
`stale-while-revalidate` strategy. This means that after the initial
field list request, all subsequent requests return the cached response
which is very fast. If the cache is determined to be stale then the
cache will update in the background and new data will be available on
the next request.
This behavior can be modified via the `data_views:cache_max_age` Kibana
advanced setting. Setting it to zero will disable the cache. All other
values (in seconds) will be used to determine whether the cache is
stale. The default value is 5 seconds.
The field list can be manually updated via the refresh button in data
view management or a hard refresh with your browser.
Note for Safari: The `stale-while-revalidate` cache directive is
unsupported, therefore it makes additional requests. If this is
impacting Kibana performance then try Chrome or Firefox.
Data View Management
<img width="1064" alt="Screenshot 2024-01-09 at 1 36 20 PM"
src="f272c19f-81b4-4697-9303-b1f8f150e2b9">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: amyjtechwriter <61687663+amyjtechwriter@users.noreply.github.com>
Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
## Summary
Two pages about ES|QL added to the Kibana guide. One page (titled ES|QL)
under the 'Kibana concepts' heading, which is an overview page. One page
added to the 'Discover' section (titled Try ES|QL) which is a short
tutorial.
Relates to:
[#244](https://github.com/elastic/platform-docs-team/issues/244)
---------
Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
https://github.com/elastic/elasticsearch/pull/97865 expands
index-pattern expressions to include a cluster alias for purposes of
excluding an entire cluster from a cross-cluster search. This allows
users to put the minus sign in front of the cluster name
(`-cluster_one:*`). The advantage to this change is that it avoids
sending any network calls to that cluster. Compare this to the existing
syntax for excluding clusters, where the minus sign is in front of the
index name (`cluster_one:-*`). The older syntax has to send the request
to the remote cluster, which if it is down (and skip_unavailable=false),
will cause the search to fail.
This PR updates the docs to reflect the new syntax.
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This PR adds documentation for:
- Drag and drop from Available Fields list
- Wildcards in field searches
- All sources and matching sources in Create Data View
## Summary
This PR updates the data view doc to include more information about
temporary data views.
Closes#144582
Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
* [DOCS] Adds content on ad hoc data view
* [DOCS] Breaks data into two steps
* Update docs/concepts/data-views.asciidoc
Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
* [DOCS] Tweaks message re: unsaved data views
Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
* [DOCS] Fixes inconsistency with role management link
* Update docs/redirects.asciidoc
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
* [DOCS] Changes index pattern to data views in intro docs
* [DOCS] Updates image of data views UI
* [DOCS] Removes faulty sentence
* [DOCS] removes sentence about index patterns
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [data.search.autocomplete] Move autocomplete method to UI settings
* Use select rather than boolean
* Add ftue tour
* Make a select rather than text box
* Only show when focused and first time page is loaded
* Add docs link
* Reverse order of sections
* Update docs/concepts/index.asciidoc
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
* Update docs/concepts/index.asciidoc
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
* Docs updates
* setting
* telemetry
* Add links to docs
* Fix translations
* Fix failing test
* Fix test
* Fix tests
* Revert changes to querybar service
* Fix discover query
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Liza K <liza.katz@elastic.co>
* [DOCS] Updates screenshots to show new theme
* [DOCS] Updates more screenshots in Discover docs
* [DOCS] Updates screenshot for license management
* [DOCS] Attempt to make the screenshots more readable