Skip to main content

Commands

Hint

This article is generated by AI translation.

jdbc-elastic parses SQL-style commands and converts them into underlying REST requests. Supported command patterns are below.

Search Operations

CommandDescriptionExample
GET .../_searchExecute search queryGET /my_index/_search { "query": { "match_all": {} } }
POST .../_searchExecute search queryPOST /my_index/_search { "query": { "term": { "user": "kimchy" } } }
GET .../_countCount documentsGET /my_index/_count
GET .../_msearchMulti searchGET /_msearch
GET .../_mgetMulti getGET /_mget
GET .../_explainGet explanationGET /my_index/_explain/1
GET .../_sourceGet document sourceGET /my_index/_source/1

Document Operations

CommandDescriptionExample
PUT .../_doc/...Create or update documentPUT /my_index/_doc/1 { "user": "kimchy" }
POST .../_doc/...Create documentPOST /my_index/_doc/ { "user": "kimchy" }
POST .../_create/...Create document (fail if exists)POST /my_index/_create/1 { "user": "kimchy" }
POST .../_update/...Update documentPOST /my_index/_update/1 { "doc": { "age": 20 } }
POST .../_update_by_queryUpdate by queryPOST /my_index/_update_by_query { "script": ... }
DELETE ...Delete documentDELETE /my_index/_doc/1
POST .../_delete_by_queryDelete by queryPOST /my_index/_delete_by_query { "query": ... }

Index Management

CommandDescriptionExample
PUT /indexCreate indexPUT /new_index
DELETE /indexDelete indexDELETE /new_index
POST .../_openOpen indexPOST /my_index/_open
POST .../_closeClose indexPOST /my_index/_close
PUT .../_mappingSet MappingPUT /my_index/_mapping { "properties": ... }
PUT .../_settingsSet SettingsPUT /my_index/_settings { "index": ... }
POST /_aliasesAlias managementPOST /_aliases { "actions": ... }
POST /_reindexReindexPOST /_reindex { "source": ..., "dest": ... }
POST .../_refreshRefresh indexPOST /my_index/_refresh

Cluster Info

CommandDescriptionExample
GET /_cat/...Get cluster infoGET /_cat/nodes?v
GET /_cluster/...Get cluster stateGET /_cluster/health

General Requests

jdbc-elastic supports any GET, POST, PUT, DELETE, HEAD requests. As long as it conforms to the ElasticSearch REST API specification, it can be executed via the JDBC interface.

Hint Support

jdbc-elastic supports overriding or enhancing query behavior via SQL Hint. The Hint format is /*+ hint_name=value */ and must be placed at the beginning of the SQL statement.

Hint NameDescriptionExample
overwrite_find_limitOverrides the size parameter of the query, used for pagination or limiting the number of returned records./*+ overwrite_find_limit=10 */ POST /idx/_search
overwrite_find_skipOverrides the from parameter of the query, used for pagination to skip a specified number of records./*+ overwrite_find_skip=20 */ POST /idx/_search
overwrite_find_as_countConverts the query to a Count operation, ignoring the returned document content and returning only the match count./*+ overwrite_find_as_count */ POST /idx/_search