Skip to content

Understand Discover -- (draft) #3112

Description

@ananzh

Discover is an internal plugin in OpenSearch Dashboards core. There are three major functions:

  • Select data for your exploration, and then set a time range for that data, search it with the OpenSearch Dashboards Query Language, and filter the results.
  • Explore the details of your data, view individual documents, and create tables that summarize the contents of the data.
  • Present your findings in a visualization.

Required plugins

  • charts
  • data: access data from OpenSearch. discover uses data plugin to do filter query and search.
    • $scope.searchSource: construct and run search
    • data.query: construct and run filters, time range query, match query and etc
      • data.query.state
      • data.query.filterManager: manager filters
      • data.query.queryString: query string
      • data.query.timefilter: time range filter
    • autocomplete wired in TopNavMenu
  • embeddable
  • inspector
  • opensearchDashboardsLegacy
  • urlForwarding: redirect and navigate to legacy url
  • navigation: provide TopNavMenu component
  • uiActions
  • visualizations: create histogram for aggregate data
  • opensearchDashboardsUtils: state manager and state sync service
  • home
  • savedObject*: loading and saving. discover uses savedObject plugin to save search.
    • a saved object type, called searchSavedObjectType
    • a saved object class, called SavedSearch, with all convenient functions
  • opensearchDashboardsReact

Setup and Start Discover

Server

Setup discover

Start discover

discover-setup-start

Public

Public setup and start are very similar to OSD server. The entry point is changed to src/core/public/osd_bootstrap.ts. The major difference is that public setup doesn’t need to build the plugin dependency tree.

Core functions

Set data

  • Open the main menu. On the navigation, click discover.
  • Click the button and set the data.
  • Set the time range.

Screen Shot 2022-07-13 at 08 53 28

Explore data fields

  • Check the available fields in the left side bar. Try search a field by its name.

Screen Shot 2022-07-12 at 23 32 36

  • Click a field and view the top values.

Screen Shot 2022-07-12 at 23 33 16

  • Click + button to add the field to Selected fields. Meanwhile, see the doc table changes on the right.

Screen Shot 2022-07-12 at 23 33 43

* Each doc table columns on the right has a column header. Column header is able to sort data or remove column.

Search data

Discover can do various types of search using DQL, such as term query, string query, boolean query, date/range query and nested query. To search all fields, enter a string in the Search field. To do a more complicated search, use DQL.

  • Enter a search and click Update.

Screen Shot 2022-07-14 at 10 28 29

Filter data

  • Click Add filter.

Screen Shot 2022-07-14 at 09 16 05

  • Set filter. Below is an example.

Screen Shot 2022-07-14 at 09 15 50

* Save filter. * Remove a filter by clicking the `x` button.

Screen Shot 2022-07-14 at 09 16 44

Explore document

  • Click the expand button on the left of the table row to view a document with details.

Screen Shot 2022-07-03 at 14 05 31

  • Click Table/JSON tab, will show a table/JSON view.

Screen Shot 2022-07-03 at 14 08 36

  • Filter in/out a value

Re-use search result (savedSearch)

  • Click Save in the top navigation to save your search. Click Open to open an existed one.

Screen Shot 2022-07-14 at 09 25 42

* Enter a title to save. * Re-use your discover and filter * In saved objects, open saved discover * In dashboards, add saved discover ( doc views) * In visualize, create a visualization using saved discover filter.

Visualize field

If a data field can be summarized as metrics, statistics, or other analytics (aggregation), discover allows you visualize it. Click the visualize button. You will be directed to a visualization.
Screen Shot 2022-07-04 at 15 11 48 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions