fixed the search query build

This commit is contained in:
SJ 2012-09-14 11:04:17 +02:00
parent ca689e4b30
commit 731c953bd6

View File

@ -247,7 +247,7 @@ class ModelSearchSearch extends Model {
if($data['any']) { if($data['any']) {
$data['any'] = $this->fixup_sphinx_operators($data['any']); $data['any'] = $this->fixup_sphinx_operators($data['any']);
$data['any'] = $this->fix_email_address_for_sphinx($data['any']); $data['any'] = $this->fix_email_address_for_sphinx($data['any']);
if($match) { $match = "($match) & "; } $match .= "(" . $data['any'] . ") "; if($match) { $match = "($match) & "; } $match .= "(@subject,@body" . $data['any'] . ") ";
} }
@ -277,9 +277,12 @@ class ModelSearchSearch extends Model {
} }
} }
if(count($__folders) > 0) {
$folders = "folder IN (" . implode(",", $__folders) . ") AND "; $folders = "folder IN (" . implode(",", $__folders) . ") AND ";
} }
}
if(isset($data['tag']) && $data['tag']) { if(isset($data['tag']) && $data['tag']) {
$id_list = $this->get_sphinx_id_list($data['tag'], SPHINX_TAG_INDEX, 'tag'); $id_list = $this->get_sphinx_id_list($data['tag'], SPHINX_TAG_INDEX, 'tag');