Hello,
I am currently integrating App search with a PHP project. I am using elasticsearch to index my documents but I use App search to query the documents, by creating engines from the indices. I am trying to use the enterprise search PHP client to automatically they create app search engines, if they don't already exist. But I cannot find a way to do that, in the docs. Is that possible ?
This is my code at the moment. I keep getting a 400 error code:
try {
$appSearchClient->getEngine(new GetEngine($appSearchEngineName));
} catch (ClientErrorResponseException $e){
if ($e->getCode() === 404){
$engine = new Engine($appSearchEngineName);
$engine->type = 'elasticsearch';
$appSearchClient->createEngine(new CreateEngine($engine));
}
}
Thanks in advance