How to check the analyzer in elasticsearch?

All kind time of day!
Please tell me how to check the analyzer?
Here is the code of the index:
$params = [
 'index' => 'mytestindex',
 'body' => [
 'settings' => [
 'analysis' => [
 'index_analyzer' => [
 'my_index_analyzer' => [
 'type' => 'custom',
 "tokenizer" => "standard",
 'filter' => [
"lowercase",
"mynGram2"
],
],
],
 'search_analyzer' => [
 'my_search_analyzer' => [
 "type" => "custom",
 "tokenizer" => "standard",
 'filter' => [
standard
"lowercase",
"mynGram2"
],
],
],
 'filter' => [
 'mynGram2' => [
 "type" => "nGram",
 "min_gram" => 2,
 "max_gram" => 20,
],
],
],
 "max_ngram_diff" => "50",
],
],
];
 $x = $this->obj->indices()->create($params);


Here's the code attempts to check:
$params = [
 'index' => 'mytestindex',
 'body' => [
 'analyzer' => 'my_search_analyzer',
 'text' => 'text to verify'
],
];

 $x = $this->obj->indices()->analyze($params);


Use Elasticsearch\Client

So. Using the above code, I get this error failed to find analyzer

I read in Google that this happens if index is not specified directly, but just something like:
$params = [
 'analyzer' => 'my_search_analyzer',
 'text' => 'text to verify'
];
$x = $this->obj->indices()->analyze($params)

But I then set the index
April 3rd 20 at 18:31
0 answer

Find more questions by tags PHPElasticsearch