p86a-e
This commit is contained in:
@@ -1342,6 +1342,37 @@ final readonly class RetriexEffectiveConfigProvider
|
||||
}
|
||||
}
|
||||
|
||||
$contextResolution = is_array($configurationValues['context_resolution'] ?? null)
|
||||
? $configurationValues['context_resolution']
|
||||
: [];
|
||||
$productListFollowUp = is_array($contextResolution['product_list_followup'] ?? null)
|
||||
? $contextResolution['product_list_followup']
|
||||
: [];
|
||||
if ($productListFollowUp !== []) {
|
||||
if (array_key_exists('enabled', $productListFollowUp) && !is_bool($productListFollowUp['enabled'])) {
|
||||
$errors[] = 'genre.configuration_values.context_resolution.product_list_followup.enabled must be boolean.';
|
||||
}
|
||||
|
||||
foreach ([
|
||||
'weak_query_max_terms',
|
||||
'weak_query_max_residual_terms',
|
||||
'max_anchors',
|
||||
] as $intKey) {
|
||||
if (array_key_exists($intKey, $productListFollowUp) && (($this->asInt($productListFollowUp[$intKey]) ?? -1) < 0)) {
|
||||
$errors[] = sprintf('genre.configuration_values.context_resolution.product_list_followup.%s must be numeric and non-negative.', $intKey);
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('template', $productListFollowUp) && (!is_string($productListFollowUp['template']) || trim($productListFollowUp['template']) === '')) {
|
||||
$errors[] = 'genre.configuration_values.context_resolution.product_list_followup.template must be a non-empty string.';
|
||||
}
|
||||
|
||||
$this->validateStringList($this->toList($productListFollowUp['product_terms'] ?? []), 'genre.configuration_values.context_resolution.product_list_followup.product_terms', $errors, $warnings);
|
||||
$this->validateStringList($this->toList($productListFollowUp['shop_terms'] ?? []), 'genre.configuration_values.context_resolution.product_list_followup.shop_terms', $errors, $warnings);
|
||||
$this->validateStringList($this->toList($productListFollowUp['noise_terms'] ?? []), 'genre.configuration_values.context_resolution.product_list_followup.noise_terms', $errors, $warnings);
|
||||
$this->validateRegexPatternList($productListFollowUp['anchor_patterns'] ?? [], 'genre.configuration_values.context_resolution.product_list_followup.anchor_patterns', $errors);
|
||||
}
|
||||
|
||||
$shopQueryRuntime = is_array($configurationValues['shop_query_runtime'] ?? null)
|
||||
? $configurationValues['shop_query_runtime']
|
||||
: [];
|
||||
|
||||
Reference in New Issue
Block a user