checkRequiredParameters(['index'], $params); $url = '/' . $this->encode($params['index']) . '/_fleet/global_checkpoints'; $method = 'GET'; $url = $this->addQueryString($url, $params, ['wait_for_advance','wait_for_index','checkpoints','timeout','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', ]; return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); } /** * Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. * * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * index: string, // The index name to use as the default * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) * human: boolean, // Return human readable values for statistics. (DEFAULT: true) * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. * filter_path: list, // A comma-separated list of filters used to reduce the response. * body: array, // (REQUIRED) The request definitions (metadata-fleet search request definition pairs), separated by newlines * } $params * * @throws NoNodeAvailableException if all the hosts are offline * @throws ClientResponseException if the status code of response is 4xx * @throws ServerResponseException if the status code of response is 5xx * * @return Elasticsearch|Promise */ public function msearch(array $params = []) { $this->checkRequiredParameters(['body'], $params); if (isset($params['index'])) { $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_msearch'; $method = empty($params['body']) ? 'GET' : 'POST'; } else { $url = '/_fleet/_fleet_msearch'; $method = empty($params['body']) ? 'GET' : 'POST'; } $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/x-ndjson', ]; return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); } /** * Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. * * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ * index: string, // (REQUIRED) The index name to search. * wait_for_checkpoints: list, // Comma separated list of checkpoints, one per shard * wait_for_checkpoints_timeout: time, // Explicit wait_for_checkpoints timeout * allow_partial_search_results: boolean, // Indicate if an error should be returned if there is a partial search failure or timeout * pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false) * human: boolean, // Return human readable values for statistics. (DEFAULT: true) * error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false) * source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. * filter_path: list, // A comma-separated list of filters used to reduce the response. * body: array, // The search definition using the Query DSL * } $params * * @throws MissingParameterException if a required parameter is missing * @throws NoNodeAvailableException if all the hosts are offline * @throws ClientResponseException if the status code of response is 4xx * @throws ServerResponseException if the status code of response is 5xx * * @return Elasticsearch|Promise */ public function search(array $params = []) { $this->checkRequiredParameters(['index'], $params); $url = '/' . $this->encode($params['index']) . '/_fleet/_fleet_search'; $method = empty($params['body']) ? 'GET' : 'POST'; $url = $this->addQueryString($url, $params, ['wait_for_checkpoints','wait_for_checkpoints_timeout','allow_partial_search_results','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', ]; return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null)); } }