chg: [correlation] Do not delete over correlation if no correlation found

pull/8572/head
Jakub Onderka 2022-09-08 12:00:02 +02:00
parent cb365a070f
commit c0017a0531
2 changed files with 3 additions and 4 deletions

View File

@ -363,7 +363,7 @@ class Correlation extends AppModel
// If we have more correlations for the value than the limit, set the block entry and stop the correlation process
$this->OverCorrelatingValue->block($cV);
return true;
} else {
} else if ($count !== 0) {
// If we have fewer hits than the limit, proceed with the correlation, but first make sure we remove any existing blockers
$this->OverCorrelatingValue->unblock($cV);
}

View File

@ -94,12 +94,11 @@ class OverCorrelatingValue extends AppModel
public function findOverCorrelatingValues(array $values_to_check): array
{
$values_to_check_truncated = array_unique(self::truncateValues($values_to_check));
$overCorrelatingValues = $this->find('column', [
$values_to_check_truncated = array_unique(self::truncateValues($values_to_check), SORT_REGULAR);
return $this->find('column', [
'conditions' => ['value' => $values_to_check_truncated],
'fields' => ['value'],
]);
return $overCorrelatingValues;
}
public function generateOccurrencesRouter()