This commit is contained in:
team 1
2026-05-03 20:51:47 +02:00
parent 3d0b6b1cf8
commit 427dfe9987
5 changed files with 88 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ final readonly class RetriexEffectiveConfigProvider
private SalesIntentConfig $salesIntentConfig,
private ShopServiceConfig $shopServiceConfig,
private StopWordsConfig $stopWordsConfig,
private LanguageCleanupConfig $languageCleanupConfig,
private QueryEnricherConfig $queryEnricherConfig,
private GovernanceConfig $governanceConfig,
private CatalogIntentConfig $catalogIntentConfig,
@@ -607,6 +608,7 @@ final readonly class RetriexEffectiveConfigProvider
private function commerceQueryConfig(): array
{
return [
'cleanup_profile' => $this->commerceQueryParserConfig->getCleanupProfile(),
'known_brands' => $this->commerceQueryParserConfig->getKnownBrands(),
'phrases_to_remove' => $this->commerceQueryParserConfig->getPhrasesToRemove(),
'filter_search_tokens' => $this->commerceQueryParserConfig->getFilterSearchTokens(),
@@ -1212,6 +1214,13 @@ final readonly class RetriexEffectiveConfigProvider
$this->validateCommerceQueryPatterns($patterns, $errors, $warnings);
}
$cleanupProfile = $commerceQuery['cleanup_profile'] ?? null;
if (!is_string($cleanupProfile) || trim($cleanupProfile) === '') {
$errors[] = 'commerce_query.cleanup_profile must be a non-empty string.';
} elseif (!in_array($cleanupProfile, $this->languageCleanupConfig->getCleanupProfileNames(), true)) {
$errors[] = 'commerce_query.cleanup_profile references unknown language cleanup profile: ' . $cleanupProfile . '.';
}
$measurementPattern = $patterns['measurement_value_token'] ?? null;
$filterTokens = $commerceQuery['filter_search_tokens'] ?? [];
foreach ($this->governanceConfig->getRegressionProtectedMeasurementValues() as $measurementValue) {