Closed issam-chouchane closed 2 years ago
Do you have a link to the .Net lib documentation?
You can check the library proposed by Elasticsearch :
Elastically rely on Elastica, you can have a look here:
So something like this should work:
// Factory object with Elastica options + new Elastically options in the same array
$factory = new Factory([
// Where to find the mappings
Factory::CONFIG_MAPPINGS_DIRECTORY => __DIR__.'/mappings',
// What object to find in each index
Factory::CONFIG_INDEX_CLASS_MAPPING => [
'beers' => Beer::class,
],
'connections' => [
['host' => 'server1', 'port' => 9200],
['host' => 'server2', 'port' => 9200],
]
]);
// Class to perform request, same as the Elastica Client
$client = $factory->buildClient();
Feel free to reopen this issue if you have any issue with the behavior of Elastically!
thank you for the exemple. Is there a yaml equivalent implementation ?
Yeaahh.
JoliCode\Elastically\Client:
arguments:
$config:
connections:
- { host: server1, port: 9200 }
- { host: server2, port: 9200 }
This issue tracker is not for support, only for bug report by the way.
that rocks. I ll let you know.
In .Net libraries we can set a cluster config in the Elastic client part by specifying the master and slaves. Can we do the same with Elasticaly, if yes could you provide an exemple of the de Yaml please ?
Thnx.