diff --git a/src/OpenSearch/Endpoints/Indices/RefreshSearchAnalyzers.php b/src/OpenSearch/Endpoints/Indices/RefreshSearchAnalyzers.php new file mode 100644 index 00000000..53a94bc2 --- /dev/null +++ b/src/OpenSearch/Endpoints/Indices/RefreshSearchAnalyzers.php @@ -0,0 +1,48 @@ +index ?? null; + + if (isset($index)) { + return "/_plugins/_refresh_search_analyzers/$index"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.refresh_search_analyzers'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/OpenSearch/Namespaces/IndicesNamespace.php b/src/OpenSearch/Namespaces/IndicesNamespace.php index 3255f8b5..3cdfb293 100644 --- a/src/OpenSearch/Namespaces/IndicesNamespace.php +++ b/src/OpenSearch/Namespaces/IndicesNamespace.php @@ -1173,6 +1173,23 @@ public function getDataStream(array $params = []) return $this->performRequest($endpoint); } + /** + * $params['index'] = (list) A comma-separated list of index names to refresh analyzers for + * + * @param array $params Associative array of parameters + * @return array + */ + public function refreshSearchAnalyzers(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this-endpoints; + $endpoint = $endpointBuilder('Indices\RefreshSearchAnalyzers'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } /** * $params['index'] = (list) A comma-separated list of index names to reload analyzers for * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed)