testing search function

This commit is contained in:
Viktor Pedersen 2021-09-08 16:36:38 +02:00
parent 9fe090ea4d
commit 2479d46bbb
2 changed files with 5 additions and 7 deletions

@ -120,9 +120,7 @@ class Product extends Entity {
'invoice',
'status',
'tag'));
print('DEBUG $terms post translation: ');
var_dump($terms);
print('<br><br>');
var_dump('DEBUG $terms post translation: ', $terms, '<br><br>');
$matches = array();
foreach($terms as $field => $values) {
if(property_exists($this, $field)) {

@ -73,26 +73,26 @@ class SearchPage extends Page {
if (!array_key_exists($key, $mustMatchArray)) {
$mustMatchArray[$key] = array();
}
$mustMatchArray[] = substr($parsedTerm, 1);
$mustMatchArray[$key][] = substr($parsedTerm, 1);
break;
case "!":
case "-":
if (!array_key_exists($key, $cannotMatchArray)) {
$cannotMatchArray[$key] = array();
}
$cannotMatchArray[] = array($key => substr($parsedTerm, 1));
$cannotMatchArray[$key][] = substr($parsedTerm, 1);
break;
case "~":
if (!array_key_exists($key, $mayMatchArray)) {
$mayMatchArray[$key] = array();
}
$mayMatchArray[] = array($key => substr($parsedTerm, 1));
$mayMatchArray[$key][] = substr($parsedTerm, 1);
break;
default:
if (!array_key_exists($key, $mayMatchArray)) {
$mayMatchArray[$key] = array();
}
$mayMatchArray[] = array($key => $parsedTerm);
$mayMatchArray[$key][] = $parsedTerm;
break;
}
}