mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 19:20:12 +01:00
Removed "aname" search prefix
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
4682697453
commit
d60b53c243
@ -8,7 +8,6 @@ class ControllerSearchHelper extends Controller {
|
||||
'date2' => '',
|
||||
'direction' => '',
|
||||
'size' => '',
|
||||
'aname' => '',
|
||||
'attachment_type' => '',
|
||||
'tag' => '',
|
||||
'note' => '',
|
||||
@ -50,7 +49,7 @@ class ControllerSearchHelper extends Controller {
|
||||
|
||||
if($this->request->post['searchtype'] == 'expert'){
|
||||
|
||||
if(isset($this->request->post['search']) && preg_match("/(from|to|subject|body|direction|d|size|date1|date2|attachment|a|aname|tag|note|id)\:/", $this->request->post['search'])) {
|
||||
if(isset($this->request->post['search']) && preg_match("/(from|to|subject|body|direction|d|size|date1|date2|attachment|a|tag|note|id)\:/", $this->request->post['search'])) {
|
||||
$this->a = $this->model_search_search->preprocess_post_expert_request($this->request->post);
|
||||
}
|
||||
else {
|
||||
|
@ -205,17 +205,7 @@ class ModelSearchSearch extends Model {
|
||||
}
|
||||
|
||||
|
||||
if(isset($data['aname']) && $data['aname']) {
|
||||
|
||||
$match = $data['aname'];
|
||||
if($emailfilter) { $match = "( $match ) & $emailfilter"; }
|
||||
|
||||
$query = $this->sphx->query("SELECT id, mid FROM " . SPHINX_ATTACHMENT_INDEX . " WHERE MATCH('" . $match . "') ORDER BY `id` $order LIMIT $offset,$pagelen OPTION max_matches=" . MAX_SEARCH_HITS);
|
||||
|
||||
$total_found = $query->total_found;
|
||||
$num_rows = $query->num_rows;
|
||||
}
|
||||
else if(isset($data['tag']) && $data['tag']) {
|
||||
if(isset($data['tag']) && $data['tag']) {
|
||||
list ($total_found, $num_rows, $id_list) = $this->get_sphinx_id_list($data['tag'], SPHINX_TAG_INDEX, 'tag', $page);
|
||||
$query = $this->sphx->query("SELECT id FROM " . SPHINX_MAIN_INDEX . " WHERE $folders id IN ($id_list) $sortorder LIMIT 0,$pagelen OPTION max_matches=" . MAX_SEARCH_HITS);
|
||||
}
|
||||
@ -324,7 +314,6 @@ class ModelSearchSearch extends Model {
|
||||
'date2' => '',
|
||||
'direction' => '',
|
||||
'size' => '',
|
||||
'aname' => '',
|
||||
'attachment_type' => '',
|
||||
'tag' => '',
|
||||
'note' => '',
|
||||
@ -360,7 +349,6 @@ class ModelSearchSearch extends Model {
|
||||
else if($v == 'date1:') { $token = 'date1'; continue; }
|
||||
else if($v == 'date2:') { $token = 'date2'; continue; }
|
||||
else if($v == 'attachment:' || $v == 'a:') { $token = 'match'; $a['match'][] = '@attachment_types'; continue; }
|
||||
else if($v == 'aname:') { $token = 'aname'; continue; }
|
||||
else if($v == 'size') { $token = 'size'; continue; }
|
||||
else if($v == 'tag:') { $token = 'tag'; continue; }
|
||||
else if($v == 'note:') { $token = 'note'; continue; }
|
||||
@ -374,13 +362,6 @@ class ModelSearchSearch extends Model {
|
||||
}
|
||||
|
||||
if($token == 'match') { $a['match'][] = $v; }
|
||||
else if($token == 'aname') {
|
||||
if($v != '|') {
|
||||
$a['aname'] .= '"' . $v . '"';
|
||||
} else {
|
||||
$a['aname'] .= ' | ';
|
||||
}
|
||||
}
|
||||
else if($token == 'date1') { $a['date1'] = ' ' . $v; }
|
||||
else if($token == 'date2') { $a['date2'] = ' ' . $v; }
|
||||
else if($token == 'tag') { $a['tag'] .= ' ' . $v; }
|
||||
|
Loading…
Reference in New Issue
Block a user