diff --git a/lib/Query/Content/CriterionVisitor/Factory/FullTextFactory.php b/lib/Query/Content/CriterionVisitor/Factory/FullTextFactory.php new file mode 100644 index 000000000..9a76b6553 --- /dev/null +++ b/lib/Query/Content/CriterionVisitor/Factory/FullTextFactory.php @@ -0,0 +1,92 @@ +fieldNameResolver = $fieldNameResolver; + $this->tokenizer = $tokenizer; + $this->parser = $parser; + $this->generator = $generator; + $this->indexingDepthProvider = $indexingDepthProvider; + } + + /** + * Create FullText Criterion Visitor. + * + * @return \EzSystems\EzPlatformSolrSearchEngine\Query\Content\CriterionVisitor\FullText + */ + public function createCriterionVisitor(): FullText + { + return new FullText( + $this->fieldNameResolver, + $this->tokenizer, + $this->parser, + $this->generator, + $this->indexingDepthProvider->getMaxDepth() + ); + } +} diff --git a/lib/Resources/config/container/solr/criterion_visitors.yml b/lib/Resources/config/container/solr/criterion_visitors.yml index 32791d2b1..bfc3800e8 100644 --- a/lib/Resources/config/container/solr/criterion_visitors.yml +++ b/lib/Resources/config/container/solr/criterion_visitors.yml @@ -258,14 +258,17 @@ services: ezpublish.search.solr.query.content.criterion_visitor.full_text: class: "%ezpublish.search.solr.query.content.criterion_visitor.full_text.class%" + factory: ['@EzSystems\EzPlatformSolrSearchEngine\Query\Content\CriterionVisitor\Factory\FullTextFactory', 'createCriterionVisitor'] + tags: + - {name: ezpublish.search.solr.query.content.criterion_visitor} + + EzSystems\EzPlatformSolrSearchEngine\Query\Content\CriterionVisitor\Factory\FullTextFactory: arguments: - "@ezpublish.search.common.field_name_resolver" - "@ezpublish.search.solr.query.query_translator.galach.tokenizer" - "@ezpublish.search.solr.query.query_translator.galach.parser" - "@ezpublish.search.solr.query.query_translator.galach.generator.edismax" - - "@=service('ezpublish.search.solr.field_mapper.indexing_depth_provider').getMaxDepth()" - tags: - - {name: ezpublish.search.solr.query.content.criterion_visitor} + - "@ezpublish.search.solr.field_mapper.indexing_depth_provider" ezpublish.search.solr.query.content.criterion_visitor.visibility: class: "%ezpublish.search.solr.query.content.criterion_visitor.visibility.class%"