Skip to main content

Elastic Specifics

Hint

This article is generated by AI translation.

dbVisitor accesses ElasticSearch data sources via the JDBC protocol through the JDBC-Elastic driver. Please note the following when using it:

Concept Analogy

In the commands provided by the ElasticSearch driver, different commands have different execution results, mainly three types (Update Count, Single Row Result, Multi-row Result):

  • Update Count: Analogous to INSERT, UPDATE, DELETE statements in relational databases, requiring executeUpdate method to execute and get results.
  • Single Row Result / Multi-row Result: Equivalent to getting query result sets when using SELECT statements in relational databases. In the ElasticSearch driver, all read commands and some commands that cannot return via update count use the result set format.
  • When retrieving the result set, the first column is the _ID field, and the second column is the _DOC field. Both fields are in string format.

User Guide

Execute Commands

  • Command Style: Use JdbcTemplate to execute raw ElasticSearch commands for reading and writing data.
  • Fluent API: Use LambdaTemplate for type-safe ElasticSearch operations.
  • BaseMapper: Use BaseMapper interface to simplify ElasticSearch CRUD operations.
  • Annotation Style: Use @Insert, @Update, @Delete annotations on Mapper interfaces to customize ElasticSearch CRUD operations.
  • File Style: Configure execution commands via tags in Mapper files.