Answer the question
In order to leave comments, you need to log in
How to test analyzer in elasticsearch?
Good day to all!
Can you please tell me how to check the analyzer?
Here is the index code:
$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);
$params = [
'index' => 'mytestindex',
'body' => [
'analyzer' => 'my_search_analyzer',
'text' => 'текст проверить чтобы'
],
];
$x = $this->obj->indices()->analyze($params);
$params = [
'analyzer' => 'my_search_analyzer',
'text' => 'текст проверить чтобы'
];
$x = $this->obj->indices()->analyze($params)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question