Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 2.69 KB

UtilsApi.md

File metadata and controls

80 lines (55 loc) · 2.69 KB

UtilsApi

All URIs are relative to http://127.0.0.1:9308

Method HTTP request Description
sql POST /sql Perform SQL requests

sql

Map<String, Object> sql(body)

Perform SQL requests

Run a query in SQL format. Expects a query parameters string that can be in two modes:

  • Select only query as query=SELECT * FROM myindex. The query string MUST be URL encoded
  • any type of query in format mode=raw&query=SHOW TABLES. The string must be as is (no URL encoding) and mode must be first. The response object depends on the query executed. In select mode the response has same format as /search operation.

Example

// Import classes:
import com.manticoresearch.client.ApiClient;
import com.manticoresearch.client.ApiException;
import com.manticoresearch.client.Configuration;
import com.manticoresearch.client.model.*;
import com.manticoresearch.client.api.UtilsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("http://127.0.0.1:9308");

        UtilsApi utilsApi = new UtilsApi(defaultClient);
 
        try {
            Object sqlresult =  utilsApi.sql("mode=raw&query=SHOW TABLES");
            System.out.println(sqlresult);  
        } catch (ApiException e) {
            System.err.println("Exception when calling UtilsApi#sql");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
body String Expects is a query parameters string that can be in two modes: * Select only query as `query=SELECT * FROM myindex`. The query string MUST be URL encoded * any type of query in format `mode=raw&query=SHOW TABLES`. The string must be as is (no URL encoding) and `mode` must be first.

Return type

Map<String, Object>

Authorization

No authorization required

HTTP request headers

  • Content-Type: text/plain
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 In case of SELECT-only in mode none the response schema is the same as of `search`. In case of `mode=raw` the response depends on the query executed. -
0 error -