PHRAS-1094_ES-LIB-UPGRADE

#time 1d
change : upgrade the php-es lib to 2.x
This commit is contained in:
Jean-Yves Gaulier
2016-04-27 20:06:36 +02:00
parent 9667fe05a4
commit 95b52c038b
3 changed files with 10 additions and 4 deletions

View File

@@ -51,7 +51,7 @@
"doctrine/dbal": "^2.4.0",
"doctrine/migrations": "^1.0.0",
"doctrine/orm": "^2.4.0",
"elasticsearch/elasticsearch": "~1.0",
"elasticsearch/elasticsearch": "~2.0",
"facebook/php-sdk": "~3.0",
"firebase/php-jwt": "^3.0.0",
"gedmo/doctrine-extensions": "~2.3.0",

View File

@@ -29,7 +29,7 @@ use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContextFactory;
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryCompiler;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\GlobalStructure;
use Alchemy\Phrasea\SearchEngine\Elastic\Thesaurus;
use Elasticsearch\Client;
use Elasticsearch\ClientBuilder;
use Hoa\Compiler;
use Hoa\File;
use Monolog\Handler\ErrorLogHandler;
@@ -153,7 +153,13 @@ class SearchEngineServiceProvider implements ServiceProviderInterface
$clientParams['logging'] = true;
}
return new Client($clientParams);
$clientBuilder = ClientBuilder::create()
->setHosts($clientParams['hosts']);
if(array_key_exists('logObject', $clientParams)) {
$clientBuilder->setLogger($clientParams['logObject']);
}
return $clientBuilder->build();
});
$app['elasticsearch.options'] = $app->share(function($app) {

View File

@@ -106,7 +106,7 @@ class Mapping
unset($field['index_analyzer'], $field['search_analyzer']);
break;
case 'indexing':
$field['index_analyzer'] = $analyzer;
$field['analyzer'] = $analyzer;
break;
case 'searching':
$field['search_analyzer'] = $analyzer;