Supported Commands
Hint
This article is generated by AI translation.
jdbc-elastic parses raw QueryDSL commands and converts them to underlying REST requests. The supported command patterns are as follows:
Search Operations
| Command | Description | Example |
|---|---|---|
GET .../_search | Execute search query | GET /my_index/_search { "query": { "match_all": {} } } |
POST .../_search | Execute search query | POST /my_index/_search { "query": { "term": { "user": "kimchy" } } } |
GET .../_count | Count documents | GET /my_index/_count |
GET .../_msearch | Batch search | GET /_msearch |
GET .../_mget | Batch get documents | GET /_mget |
GET .../_explain | Get explanation info | GET /my_index/_explain/1 |
GET .../_source | Get document source data | GET /my_index/_source/1 |
Document Operations
| Command | Description | Example |
|---|---|---|
PUT .../_doc/... | Create or update document | PUT /my_index/_doc/1 { "user": "kimchy" } |
POST .../_doc/... | Create document | POST /my_index/_doc/ { "user": "kimchy" } |
POST .../_create/... | Create document (fails if exists) | POST /my_index/_create/1 { "user": "kimchy" } |
POST .../_update/... | Update document | POST /my_index/_update/1 { "doc": { "age": 20 } } |
POST .../_update_by_query | Update by query | POST /my_index/_update_by_query { "script": ... } |
DELETE ... | Delete document | DELETE /my_index/_doc/1 |
POST .../_delete_by_query | Delete by query | POST /my_index/_delete_by_query { "query": ... } |
Index Management
| Command | Description | Example |
|---|---|---|
PUT /index | Create index | PUT /new_index |
DELETE /index | Delete index | DELETE /new_index |
POST .../_open | Open index | POST /my_index/_open |
POST .../_close | Close index | POST /my_index/_close |
PUT .../_mapping | Set Mapping | PUT /my_index/_mapping { "properties": ... } |
PUT .../_settings | Set Settings | PUT /my_index/_settings { "index": ... } |
POST /_aliases | Alias management | POST /_aliases { "actions": ... } |
POST /_reindex | Reindex | POST /_reindex { "source": ..., "dest": ... } |
POST .../_refresh | Refresh index | POST /my_index/_refresh |
Cluster Info
| Command | Description | Example |
|---|---|---|
GET /_cat/... | Get cluster info | GET /_cat/nodes?v |
GET /_cluster/... | Get cluster status | GET /_cluster/health |
Generic Requests
jdbc-elastic supports arbitrary GET, POST, PUT, DELETE, HEAD requests. As long as they conform to the ElasticSearch REST API specification, they can be executed through the JDBC interface.
Hint Support
jdbc-elastic supports overriding or enhancing query behavior through SQL Hints. The Hint format is /*+ hint_name=value */ and must be placed at the beginning of the SQL statement.
| Hint Name | Description | Example |
|---|---|---|
overwrite_find_limit | Override the query's size parameter for pagination or limiting returned rows. | /*+ overwrite_find_limit=10 */ POST /idx/_search |
overwrite_find_skip | Override the query's from parameter to skip a specified number of rows for pagination. | /*+ overwrite_find_skip=20 */ POST /idx/_search |
overwrite_find_as_count | Convert the query to a Count operation, ignoring returned document content and returning only the match count. | /*+ overwrite_find_as_count */ POST /idx/_search |