diff --git a/src/lib/Query/Content/CriterionVisitor/ContentName.php b/src/lib/Query/Content/CriterionVisitor/ContentName.php new file mode 100644 index 00000000..71a94208 --- /dev/null +++ b/src/lib/Query/Content/CriterionVisitor/ContentName.php @@ -0,0 +1,33 @@ +operator === Criterion\Operator::LIKE; + } + + public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null): string + { + /** @var string $value */ + $value = $criterion->value; + $searchField = 'meta_content__name_s'; + + 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 df8fc881..7ab6c403 100644 --- a/src/lib/Resources/config/container/solr/criterion_visitors.yml +++ b/src/lib/Resources/config/container/solr/criterion_visitors.yml @@ -236,6 +236,11 @@ services: tags: - {name: ibexa.search.solr.query.content.criterion.visitor} + Ibexa\Solr\Query\Content\CriterionVisitor\ContentName: + tags: + - {name: ibexa.search.solr.query.content.criterion.visitor} + - {name: ibexa.search.solr.query.location.criterion.visitor} + # Location search Ibexa\Solr\Query\Location\CriterionVisitor\Ancestor: tags: