Skip to main content

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

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 .../_msearchBatch searchGET /_msearch
GET .../_mgetBatch get documentsGET /_mget
GET .../_explainGet explanation infoGET /my_index/_explain/1
GET .../_sourceGet document source dataGET /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 (fails 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 statusGET /_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 NameDescriptionExample
overwrite_find_limitOverride the query's size parameter for pagination or limiting returned rows./*+ overwrite_find_limit=10 */ POST /idx/_search
overwrite_find_skipOverride the query's from parameter to skip a specified number of rows for pagination./*+ overwrite_find_skip=20 */ POST /idx/_search
overwrite_find_as_countConvert the query to a Count operation, ignoring returned document content and returning only the match count./*+ overwrite_find_as_count */ POST /idx/_search