How to analyse a string using the php api How to analyse a string using the php api elasticsearch elasticsearch

How to analyse a string using the php api


It's in the Indices name space:

 /*** $params['index'] = (string) The name of the index to scope the operation* ['analyzer'] = (string) The name of the analyzer to use* ['field'] = (string) Use the analyzer configured for this field (instead of passing the analyzer name)* ['filters'] = (list) A comma-separated list of filters to use for the analysis* ['prefer_local'] = (boolean) With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true)* ['text'] = (string) The text on which the analysis should be performed (when request body is not used)* ['tokenizer'] = (string) The name of the tokenizer to use for the analysis* ['format'] = (enum) Format of the output* ['body'] = (enum) Format of the output** @param $params array Associative array of parameters** @return array*/public function analyze($params = array()){$index = $this->extractArgument($params, 'index');$body = $this->extractArgument($params, 'body');/** @var callback $endpointBuilder */$endpointBuilder = $this->dicEndpoints;/** @var \Elasticsearch\Endpoints\Indices\Analyze $endpoint */$endpoint = $endpointBuilder('Indices\Analyze');$endpoint->setIndex($index)->setBody($body);$endpoint->setParams($params);$response = $endpoint->performRequest();return $response['data'];}

https://github.com/elasticsearch/elasticsearch-php/blob/master/src/Elasticsearch/Namespaces/IndicesNamespace.php