testing search function
This commit is contained in:
parent
9fe090ea4d
commit
2479d46bbb
include
@ -120,9 +120,7 @@ class Product extends Entity {
|
|||||||
'invoice',
|
'invoice',
|
||||||
'status',
|
'status',
|
||||||
'tag'));
|
'tag'));
|
||||||
print('DEBUG $terms post translation: ');
|
var_dump('DEBUG $terms post translation: ', $terms, '<br><br>');
|
||||||
var_dump($terms);
|
|
||||||
print('<br><br>');
|
|
||||||
$matches = array();
|
$matches = array();
|
||||||
foreach($terms as $field => $values) {
|
foreach($terms as $field => $values) {
|
||||||
if(property_exists($this, $field)) {
|
if(property_exists($this, $field)) {
|
||||||
|
@ -73,26 +73,26 @@ class SearchPage extends Page {
|
|||||||
if (!array_key_exists($key, $mustMatchArray)) {
|
if (!array_key_exists($key, $mustMatchArray)) {
|
||||||
$mustMatchArray[$key] = array();
|
$mustMatchArray[$key] = array();
|
||||||
}
|
}
|
||||||
$mustMatchArray[] = substr($parsedTerm, 1);
|
$mustMatchArray[$key][] = substr($parsedTerm, 1);
|
||||||
break;
|
break;
|
||||||
case "!":
|
case "!":
|
||||||
case "-":
|
case "-":
|
||||||
if (!array_key_exists($key, $cannotMatchArray)) {
|
if (!array_key_exists($key, $cannotMatchArray)) {
|
||||||
$cannotMatchArray[$key] = array();
|
$cannotMatchArray[$key] = array();
|
||||||
}
|
}
|
||||||
$cannotMatchArray[] = array($key => substr($parsedTerm, 1));
|
$cannotMatchArray[$key][] = substr($parsedTerm, 1);
|
||||||
break;
|
break;
|
||||||
case "~":
|
case "~":
|
||||||
if (!array_key_exists($key, $mayMatchArray)) {
|
if (!array_key_exists($key, $mayMatchArray)) {
|
||||||
$mayMatchArray[$key] = array();
|
$mayMatchArray[$key] = array();
|
||||||
}
|
}
|
||||||
$mayMatchArray[] = array($key => substr($parsedTerm, 1));
|
$mayMatchArray[$key][] = substr($parsedTerm, 1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!array_key_exists($key, $mayMatchArray)) {
|
if (!array_key_exists($key, $mayMatchArray)) {
|
||||||
$mayMatchArray[$key] = array();
|
$mayMatchArray[$key] = array();
|
||||||
}
|
}
|
||||||
$mayMatchArray[] = array($key => $parsedTerm);
|
$mayMatchArray[$key][] = $parsedTerm;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user