[Discover][doc] Add view document (#92472) (#98715)

*  Adds info about the doc viewer of Discover
* Merges with the context view doc

Co-authored-by: Gail Chappell <gail.chappell@elastic.co>

Co-authored-by: Gail Chappell <gail.chappell@elastic.co>
This commit is contained in:
Matthias Wilhelm 2021-04-29 10:58:11 +02:00 committed by GitHub
parent 4e3a93f4c2
commit 8b8f24c251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 64 additions and 63 deletions

View file

@ -1,60 +0,0 @@
[[discover-document-context]]
== View surrounding documents
Once you've narrowed your search to a specific event in *Discover*,
you can inspect the documents that occurred
immediately before and after the event.
To view the surrounding documents, your index pattern must contain time-based events.
. In the document table, click the expand icon (>).
. Click *View surrounding documents.*
+
In the context view, documents are sorted by the time field specified in the index pattern
and displayed using the same set of columns as the *Discover* view from which
the context was opened. The anchor document is highlighted in blue.
+
[role="screenshot"]
image::images/discover-context.png[Image showing context view feature, with anchor documents highlighted in blue]
+
The filters you applied in *Discover* are carried over to the context view. Pinned
filters remain active, while normal filters are copied in a disabled state.
+
[role="screenshot"]
image::images/discover-context-filters-inactive.png[Filter in context view]
. To find the documents of interest, add filters.
. To increase the number of documents that surround the anchor document, click *Load*.
By default, five documents are added with each click.
+
[role="screenshot"]
image::images/discover-context-load-newer-documents.png[Load button and the number of documents to load]
[float]
[[configure-context-ContextView]]
=== Configure the context view
Configure the appearance and behavior in *Advanced Settings*.
. Open the main menu, then click *Stack Management > Advanced Settings*.
. Search for `context`, then edit the settings.
+
[horizontal]
`context:defaultSize`:: The number of documents to display by default.
`context:step`:: The default number of documents to load with each button click. The default is 5.
`context:tieBreakerFields`:: The field to use for tiebreaking in case of equal time field values.
The default is the `_doc` field.
+
You can enter a comma-separated list of field
names, which is checked in sequence for suitability when a context is
displayed. The first suitable field is used as the tiebreaking
field. A field is suitable if the field exists and is sortable in the index
pattern the context is based on.
+
Although not required, it is recommended to only
use fields that have {ref}/doc-values.html[doc values] enabled to achieve
good performance and avoid unnecessary {ref}/modules-fielddata.html[field
data] usage. Common examples for suitable fields include log line numbers,
monotonically increasing counters and high-precision timestamps.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

View file

@ -0,0 +1,56 @@
[[discover-view-document]]
== View a document
Once you've found a document of interest in *Discover*, you have two more ways to
view it: in a view by itself or in context with surrounding documents.
[float]
[[discover-view-single-document]]
=== View a single document
Access a single document so you can bookmark it and share the link.
. In the document table, click the expand icon (>).
. In the expanded view, click **View single document**.
+
You can view the document in two ways. The **Table** view displays the document fields row-by-row.
The **JSON** (JavaScript Object Notation) view allows you to look at how {es} returns the document.
+
[role="screenshot"]
image::images/discover-view-single-document.png[Discover single document view]
+
The link is valid for the time the document is available in Elasticsearch. To create a customized view of the document,
you can create <<external-plugin-development, your own plugin>>.
[float]
[[discover-view-surrounding-documents]]
=== View surrounding documents
To inspect the documents that occurred immediately before and after a document,
your index pattern must contain time-based events.
. In the document table, click the expand icon (>).
. In the expanded view, click **View surrounding documents**.
+
Documents are displayed using the same set of columns as the *Discover* view from which
the context was opened. The anchor document is highlighted in blue.
+
[role="screenshot"]
image::images/discover-context.png[Image showing context view feature, with anchor documents highlighted in blue]
+
The filters you applied in *Discover* are carried over to the context view. Pinned
filters remain active, while normal filters are copied in a disabled state.
+
[role="screenshot"]
image::images/discover-context-filters-inactive.png[Filter in context view]
. To find the documents of interest, add filters.
. To increase the number of documents that surround the anchor document, click *Load*.
By default, five documents are added with each click.
+
[role="screenshot"]
image::images/discover-context-load-newer-documents.png[Load button and the number of documents to load]
. To configure the number of documents to display and
the number of documents to load with each button click, go to *Stack Management > Advanced Settings*
and edit the <<kibana-discover-settings, context settings>>.

View file

@ -318,3 +318,8 @@ This content has moved. refer to <<tutorial-secure-access-to-kibana>>.
== Search your data
This content has moved. refer to <<kuery-query>>.
[role="exclude",id="discover-document-context"]
== View surrounding documents
This content has moved. refer to <<discover-view-surrounding-documents>>.

View file

@ -173,9 +173,9 @@ image:images/document-table-expanded.png[Table view with document expanded]
hover of its name for filters and other controls.
. To view documents that occurred before or after the event you are looking at, click
<<discover-document-context, View surrounding documents>>.
<<discover-view-surrounding-documents, View surrounding documents>>.
. For direct access to a particular document, click **View single document**.
. For direct access to a particular document, click **<<discover-view-single-document,View single document>>**.
+
You can bookmark this document and share the link.
@ -243,7 +243,7 @@ the table columns that display by default, and more.
--
include::{kib-repo-dir}/discover/context.asciidoc[]
include::{kib-repo-dir}/discover/view-document.asciidoc[]
include::{kib-repo-dir}/discover/search-for-relevance.asciidoc[]