mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Refactor thesaurus query build
- Look for text nodes and infer the concepts behind term using thesaurus - Use value objects for thesaurus terms and concepts - Pass a QueryContext holding allowed fields and locales informations when building the Elasticsearch query - Change type hinting and name of query building method on nodes - Remove unused method Node#isFullTextOnly() - Move getFieldsStructure from RecordIndexer to RecordHelper for reusing field structure in SearchEngine
This commit is contained in:
@@ -18,6 +18,7 @@ use Alchemy\Phrasea\SearchEngine\Elastic\ElasticSearchEngine;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Indexer;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Indexer\RecordIndexer;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Indexer\TermIndexer;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\RecordHelper;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryParser;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Thesaurus;
|
||||
use Alchemy\Phrasea\SearchEngine\Phrasea\PhraseaEngine;
|
||||
@@ -87,6 +88,7 @@ class SearchEngineServiceProvider implements ServiceProviderInterface
|
||||
|
||||
$app['elasticsearch.indexer.record_indexer'] = $app->share(function ($app) {
|
||||
return new RecordIndexer(
|
||||
$app['elasticsearch.record_helper'],
|
||||
$app['thesaurus'],
|
||||
$app['elasticsearch.engine'],
|
||||
$app['phraseanet.appbox'],
|
||||
@@ -94,6 +96,10 @@ class SearchEngineServiceProvider implements ServiceProviderInterface
|
||||
);
|
||||
});
|
||||
|
||||
$app['elasticsearch.record_helper'] = $app->share(function ($app) {
|
||||
return new RecordHelper($app['phraseanet.appbox']);
|
||||
});
|
||||
|
||||
$app['elasticsearch.client'] = $app->share(function($app) {
|
||||
$options = $app['elasticsearch.options'];
|
||||
$clientParams = ['hosts' => [sprintf('%s:%s', $options['host'], $options['port'])]];
|
||||
|
Reference in New Issue
Block a user