Skip to main content

SQL Console for Elasticsearch

Use NineData SQL Console to manage Elasticsearch data sources from a web workspace. Browse indexes, run Elasticsearch commands, and review execution results from one interface.

Background

Elasticsearch is an open-source distributed search and analytics engine for fast, scalable storage, search, and analysis of large structured and unstructured datasets.

As a distributed system, Elasticsearch provides high availability and horizontal scalability by storing data shards on multiple servers. It uses an inverted index to support efficient full-text search and analytical queries.

NineData SQL Console supports both visual index browsing and command-based Elasticsearch operations, so teams can manage Elasticsearch data sources without switching tools.

Feature overview

SQL Console provides these capabilities for Elasticsearch data sources.

Feature
Description
Visual managementAccess and view Elasticsearch indexes from a visual interface.
EditorRun Elasticsearch commands in a command-line editor.
Workspace recoveryReopen the SQL Console after a browser exit or crash and restore previously opened data sources and executed commands. The page state is stored in the cloud, so recovery is not tied to one browser or host.
Execution historyHistory records commands executed by the current account in the NineData console. Search by data source, execution time, command keyword, or other fields, then copy and rerun commands from history.

Before you begin

  • Add the target Elasticsearch data source to NineData. For details, see Managing Data Sources.

  • In organization mode (DevOps Enterprise), you must have read-only, DML, or DDL permissions for the target data source.

    tip

    Read-only permission supports query operations only.

  • In the commercial versions (DevOps Pro, DevOps Enterprise), make sure your monthly or yearly subscription has not expired. An expired subscription may prevent you from using the Database DevOps service. Check the remaining quota and expiration date in the NineData Console header.

    check_quota

Procedure

  1. Sign in to the NineData Console.

  2. Go to DevOps > SQL Console.

    tip

    If you previously opened a data source and did not close it, NineData reopens that data source.

  3. Select the field below SQL Console. In the data source list, select the target data source and click Query to open the SQL Console.

    tip
    • If no Data Source exists yet, the page is empty. Click Create Datasource on the page.
    • If you have multiple data sources, enter all or part of a keyword to search by these fields:
      • Data source name
      • IP address
  4. After the SQL Console opens, manage the Elasticsearch data source from the interface. For details, see Interface reference.

Result

The SQL Console opens for the selected Elasticsearch data source. Browse indexes, execute Elasticsearch commands, and inspect execution details and JSON result sets.

Next steps

  • Review Interface reference to understand each area of the SQL Console.
  • Use execution history to locate previous commands and rerun them when needed.

Interface reference

es_interface

Number
Feature
Description
1SQL Console TabRepresents the currently opened data source SQL Console. Use tabs to switch between SQL Consoles, and click X on a tab to close it. The right-click menu supports these actions:
  • Instance Details: Open the current data source details window.
  • New Query: Open a new data source SQL Console.
  • Close Tab: Close the current tab.
2Open Data SourceSelect and open a new data source SQL Console.
3Data Source InformationDisplays the current SQL Console data source, including environment, IP address, and port number.
Right-click menu:
  • Instance Details: View detailed information about the current data source, including username, connection address, runtime, and number of connections.
  • Refresh: Refresh data source information.
4Favorite|Refresh
  • Favorite: Click the favorite icon to add the current data source to My Favorites for quick access when you create a new SQL Console.
  • Refresh: Refresh the data in the current data source.
5Function Buttons
  • execute: Execute Execute the selected Elasticsearch commands.
  • collect: Favorite this SQL: Save all SQL statements in the current SQL Console to the SQL list for later use.
  • sqlfile: Favorites: View saved SQL statements. Insert the target SQL with Insert, or use Edit and Delete.
  • time: History: View SQL execution history for the target data source. Filter execution history by time period or search by keyword, such as SQL statement, database name, or error message.
  • setting02: Settings Set the result display mode and SQL Console font size.
    • Results: Select Overwrite or Append.
      • Overwrite (default): Replace the previous execution result with the new result set.
      • Append: Create a new tab for the new result set.
    • Theme: Change the SQL Console theme to Light or Dark.
    • Font Size: Drag the slider to adjust the command font size. Default values:
      • Windows: 16
      • MacOS: 13
  • admin: Enable Admin Mode|Disable Admin Mode Only Administrator can use this mode. When enabled, all SQL executed in the SQL Console bypasses standardization and approval flows.
  • expend: Full Screen Open the SQL Console in full-screen mode. In full-screen mode, click compress Exit in the toolbar to restore the original size.
6SearchEnter an index name to quickly access the target index. Use the complete index name for exact search, or enter partial characters for fuzzy search.
8Index ListDisplays indexes in the current Elasticsearch data source. Use this list to perform these operations:
  • Get Index Data: Right-click the target index and click Get Index Data to generate and execute a command that queries the target index data.
  • Index Details: Right-click the target index and click Index Details to view index details, including status, Settings (index configuration), Mappings (index structure and field properties), Stats (index statistics and metrics), and more.
  • Generate DDL: Right-click the target index and click Generate DDL to generate the command script for creating the index.
  • New Query: Right-click any object and click New Query to open a new SQL Console tab.
  • Refresh: Right-click any object and click Refresh to refresh the index list.
9Command Line WindowRuns Elasticsearch commands. For supported command syntax, see the official documentation. The command line window supports these features:
  • Execute Elasticsearch commands: Run a single command or multiple commands.
  • Syntax highlighting
  • Right-click menu:
    • Execute: Execute the Elasticsearch command at the cursor position.
    • Favorite this SQL: Save all SQL statements in the current SQL Console to the SQL list for later use.
    • Favorites: View saved SQL statements. Insert the target SQL with Insert, or use Edit and Delete.
    • History: View SQL execution history for the target data source. Filter execution history by time period or search by keyword, such as SQL statement, database name, or error message.
    • Common operations: Cut, Copy, Paste, and Select All.
    • Select Current SQL: Select the command at the cursor position.
10Execution Information, Result SetDisplays command execution information and results.
  • Execution Information: Includes execution time, executed command, and execution details.
  • Result Set: Displays returned command results in JSON format. Hover over the target result set tab to view the command for that result set.