diff --git a/src/lib/CoreFilter/NativeCoreFilter.php b/src/lib/CoreFilter/NativeCoreFilter.php index 09843a5a..ef32772f 100644 --- a/src/lib/CoreFilter/NativeCoreFilter.php +++ b/src/lib/CoreFilter/NativeCoreFilter.php @@ -24,6 +24,7 @@ * - prioritized languages fallback * - always available language fallback * - main language search + * - optionally ignore language filter, search in all translations */ class NativeCoreFilter extends CoreFilter { @@ -104,14 +105,20 @@ public function apply(Query $query, array $languageSettings, $documentTypeIdenti $excludeTranslationsFromAlwaysAvailable = $languageSettings['excludeTranslationsFromAlwaysAvailable'] ?? true; + $excludeCoreCriterion = + $languageSettings['excludeCoreCriterion'] ?? false; + $criteria = [ new CustomField(self::FIELD_DOCUMENT_TYPE, Operator::EQ, $documentTypeIdentifier), - $this->getCoreCriterion( + ]; + + if (!$excludeCoreCriterion) { + $criteria[] = $this->getCoreCriterion( $languages, $useAlwaysAvailable, $excludeTranslationsFromAlwaysAvailable - ), - ]; + ); + } if ($query->filter !== null) { $criteria[] = $query->filter;