From acb3ab7a9cd6e2cb72c2f305ffa8d6a481bbef4b Mon Sep 17 00:00:00 2001 From: Tomasz Kryszan Date: Fri, 12 Jan 2024 13:04:36 +0100 Subject: [PATCH] Dropped Tokenizer --- .../Content/CriterionVisitor/ContentName.php | 25 +------------------ .../container/solr/criterion_visitors.yml | 4 --- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/lib/Query/Content/CriterionVisitor/ContentName.php b/src/lib/Query/Content/CriterionVisitor/ContentName.php index c27f9dc4..71a94208 100644 --- a/src/lib/Query/Content/CriterionVisitor/ContentName.php +++ b/src/lib/Query/Content/CriterionVisitor/ContentName.php @@ -10,31 +10,12 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Solr\Query\CriterionVisitor; -use QueryTranslator\Languages\Galach\Generators\ExtendedDisMax; -use QueryTranslator\Languages\Galach\Parser; -use QueryTranslator\Tokenizing; /** * @internal */ final class ContentName extends CriterionVisitor { - private Tokenizing $tokenizer; - - private Parser $parser; - - private ExtendedDisMax $generator; - - public function __construct( - Tokenizing $tokenizer, - Parser $parser, - ExtendedDisMax $generator - ) { - $this->tokenizer = $tokenizer; - $this->parser = $parser; - $this->generator = $generator; - } - public function canVisit(Criterion $criterion): bool { return $criterion instanceof Criterion\ContentName @@ -45,12 +26,8 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null) { /** @var string $value */ $value = $criterion->value; - $tokenSequence = $this->tokenizer->tokenize($value); - $syntaxTree = $this->parser->parse($tokenSequence); - - $queryString = $this->generator->generate($syntaxTree); $searchField = 'meta_content__name_s'; - return "{!edismax v='{$this->escapeQuote($queryString)}' qf='{$searchField}' uf=-*}"; + return "{!edismax v='{$this->escapeQuote($value)}' qf='{$searchField}' uf=-*}"; } } diff --git a/src/lib/Resources/config/container/solr/criterion_visitors.yml b/src/lib/Resources/config/container/solr/criterion_visitors.yml index 3079945b..7ab6c403 100644 --- a/src/lib/Resources/config/container/solr/criterion_visitors.yml +++ b/src/lib/Resources/config/container/solr/criterion_visitors.yml @@ -237,10 +237,6 @@ services: - {name: ibexa.search.solr.query.content.criterion.visitor} Ibexa\Solr\Query\Content\CriterionVisitor\ContentName: - arguments: - $tokenizer: '@ibexa.solr.query.query_translator.galach.tokenizer' - $parser: '@ibexa.solr.query.query_translator.galach.parser' - $generator: '@ibexa.solr.query.query_translator.galach.generator.edismax' tags: - {name: ibexa.search.solr.query.content.criterion.visitor} - {name: ibexa.search.solr.query.location.criterion.visitor}