-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Target non-default analyzer fields in exact search.
- Loading branch information
1 parent
60ee892
commit be83195
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...dule-elasticsuite-core/Search/Request/Query/Fulltext/NonStandardSearchableFieldFilter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer | ||
* versions in the future. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteCore | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
* @copyright 2023 Smile | ||
* @license Open Software License ("OSL") v. 3.0 | ||
*/ | ||
|
||
namespace Smile\ElasticsuiteCore\Search\Request\Query\Fulltext; | ||
|
||
use Smile\ElasticsuiteCore\Api\Index\Mapping\FieldInterface; | ||
|
||
/** | ||
* Indicates if a field is used in search with a non-default analyzer. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteCore | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
*/ | ||
class NonStandardSearchableFieldFilter extends SearchableFieldFilter | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function filterField(FieldInterface $field) | ||
{ | ||
return parent::filterField($field) && ($field->getDefaultSearchAnalyzer() !== FieldInterface::ANALYZER_STANDARD); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters