I am currently trying to make setting in my index just like below
PUT my_index
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": "20"
}
}
}
}
}
What should I modify in the php file so that I can apply the above setting in my index?
require 'vendor/autoload.php';
//$set=$_PUT['p'];
//set host
$hosts =['my_host'];
//
$client = Elasticsearch\ClientBuilder::create()->setHosts($hosts)->build();
// Set the index
$params = [
'index' => 'my_index',
'body' => [
'settings' => [
'analysis' =>
'my_analyzer': [
'type'=>'edge_ngram',
'min_gram'=> 1,
'max_gram'=> 20
]
],
]
];
$response = $client->indices()->putSettings($params);
echo $response;