Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Restore context documentation #90784

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions docs/discover/context.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[[discover-document-context]]
== View a document in context
kertal marked this conversation as resolved.
Show resolved Hide resolved

Once you've narrowed your search to a specific event,
you might want to inspect the documents that occurred
immediately before and after the event. With the Context view,
kertal marked this conversation as resolved.
Show resolved Hide resolved
you can do just that for index patterns that contain time-based events.
kertal marked this conversation as resolved.
Show resolved Hide resolved

To open the Context view, click the expand icon (>) in the document table, and then click
kertal marked this conversation as resolved.
Show resolved Hide resolved
*View surrounding documents.*
kertal marked this conversation as resolved.
Show resolved Hide resolved

kertal marked this conversation as resolved.
Show resolved Hide resolved
The documents are sorted by the time field specified in the index pattern
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The documents are sorted by the time field specified in the index pattern
+
The 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.

kertal marked this conversation as resolved.
Show resolved Hide resolved
kertal marked this conversation as resolved.
Show resolved Hide resolved

kertal marked this conversation as resolved.
Show resolved Hide resolved
[role="screenshot"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change the context view to show the anchor doc in the middle, so the reader sees docs both above and below the anchor.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I've changed it new file is also smaller in size but better in resolution, so it's a win
discover-context

image::images/Discover-ContextView.png[Image showing context view feature, with anchor documents highlighted in blue]

[float]
[[filter-context]]
=== Filter the context
kertal marked this conversation as resolved.
Show resolved Hide resolved

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.
You can re-enable these filters to refine your context view.

If the Context view contains a large number of documents not related to the event under
investigation, you can use filters to restrict the documents to display.

[float]
[[change-context-size]]
=== Change the number of surrounding documents

By default, the five newest and oldest
documents are listed. To increase the number of documents that surround the anchor document,
kertal marked this conversation as resolved.
Show resolved Hide resolved
click *Load*. Five documents are added with each click.
kertal marked this conversation as resolved.
Show resolved Hide resolved

[float]
[[configure-context-ContextView]]
=== Configure the context view

To configure the Context view, use these settings in <<advanced-options,
kertal marked this conversation as resolved.
Show resolved Hide resolved
Advanced Settings>>.
kertal marked this conversation as resolved.
Show resolved Hide resolved

[horizontal]
`context:defaultSize`:: The number of documents to display by default.
`context:step`:: The default number of documents to load with each button click.
kertal marked this conversation as resolved.
Show resolved Hide resolved
`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.
7 changes: 6 additions & 1 deletion docs/user/discover.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ image:images/document-table-expanded.png[Table view with document expanded]
. Scan through the fields and their values. If you find a field of interest,
hover of its name for filters and other controls.

. To view documents that occurred before or after the event you are looking at, click **View surrounding documents**.
. To view documents that occurred before or after the event you are looking at, click
<<discover-document-context, View surrounding documents>>.

. For direct access to a particular document, click **View single document**.
+
Expand Down Expand Up @@ -216,3 +217,7 @@ include::{kib-repo-dir}/management/index-patterns.asciidoc[]
include::{kib-repo-dir}/discover/set-time-filter.asciidoc[]

include::{kib-repo-dir}/discover/search.asciidoc[]

include::{kib-repo-dir}/discover/context.asciidoc[]


kertal marked this conversation as resolved.
Show resolved Hide resolved