diff --git a/etc/sphinx.conf.in b/etc/sphinx.conf.in index 6558f8d5..f96bdff8 100644 --- a/etc/sphinx.conf.in +++ b/etc/sphinx.conf.in @@ -37,7 +37,7 @@ source delta : base sql_query_pre = SET NAMES utf8mb4 sql_query_pre = REPLACE INTO sph_counter SELECT 1, IFNULL(MAX(id), 0) FROM sph_index sql_query_post_index = DELETE FROM sph_index WHERE id<=(SELECT max_doc_id FROM sph_counter WHERE counter_id=1) - sql_query = SELECT id, `from` as sender, `to`, `fromdomain`, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index \ + sql_query = SELECT id, `from` as sender, `to`, `fromdomain` as senderdomain, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index \ WHERE id <= (SELECT max_doc_id FROM sph_counter WHERE counter_id=1) @@ -50,31 +50,31 @@ source delta : base source main1 : base { sql_query_pre = SET NAMES utf8mb4 - sql_query = SELECT id, `from` as sender, `to`, `fromdomain`, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 + sql_query = SELECT id, `from` as sender, `to`, `fromdomain` as senderdomain, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 } source main2 : base { sql_query_pre = SET NAMES utf8mb4 - sql_query = SELECT id, `from` as sender, `to`, `fromdomain`, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 + sql_query = SELECT id, `from` as sender, `to`, `fromdomain` as senderdomain, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 } source main3 : base { sql_query_pre = SET NAMES utf8mb4 - sql_query = SELECT id, `from` as sender, `to`, `fromdomain`, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 + sql_query = SELECT id, `from` as sender, `to`, `fromdomain` as senderdomain, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 } source main4 : base { sql_query_pre = SET NAMES utf8mb4 - sql_query = SELECT id, `from` as sender, `to`, `fromdomain`, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 + sql_query = SELECT id, `from` as sender, `to`, `fromdomain` as senderdomain, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 } source dailydelta : base { sql_query_pre = SET NAMES utf8mb4 - sql_query = SELECT id, `from` as sender, `to`, `fromdomain`, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 + sql_query = SELECT id, `from` as sender, `to`, `fromdomain` as senderdomain, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index WHERE id=-1 } source tag : base diff --git a/tests/cases/05-smtp.inc b/tests/cases/05-smtp.inc index 3bf66045..e6e26230 100644 --- a/tests/cases/05-smtp.inc +++ b/tests/cases/05-smtp.inc @@ -62,7 +62,7 @@ run_05_sphinx_tests() { append_queries() { append_query "select * from main1,dailydelta1,delta1 WHERE MATCH('@subject budaörsi dc felmérés')" 9 - append_query "select * from main1,dailydelta1,delta1 WHERE MATCH('@from gruppi.hu')" 4 + append_query "select * from main1,dailydelta1,delta1 WHERE MATCH('@sender gruppi.hu')" 4 append_query "select * from main1,dailydelta1,delta1 WHERE attachments > 0 AND MATCH('@subject spam ')" 85 append_query "select * from main1,dailydelta1,delta1 WHERE attachments > 0 AND MATCH('@subject spam @attachment_types image')" 15 append_query "select * from main1,dailydelta1,delta1 WHERE MATCH('@(subject,body) New Task TSK002*')" 29 diff --git a/webui/controller/search/helper.php b/webui/controller/search/helper.php index 399f3233..086ec01a 100644 --- a/webui/controller/search/helper.php +++ b/webui/controller/search/helper.php @@ -98,7 +98,7 @@ class ControllerSearchHelper extends Controller { private function fixup_post_simple_request() { $match = ''; - if(isset($this->request->post['from']) && $this->request->post['from']) { $match .= "@from " . $this->request->post['from'] . ' '; } + if(isset($this->request->post['from']) && $this->request->post['from']) { $match .= "@sender " . $this->request->post['from'] . ' '; } if(isset($this->request->post['to']) && $this->request->post['to']) { $match .= "@to " . $this->request->post['to'] . ' '; } if(isset($this->request->post['subject']) && $this->request->post['subject']) { $match .= "@subject " . $this->request->post['subject'] . ' '; } if(isset($this->request->post['body']) && $this->request->post['body']) { $match .= "@body " . $this->request->post['body'] . ' '; } @@ -149,7 +149,7 @@ class ControllerSearchHelper extends Controller { } else if(strchr($v, '@')) { $prev_token_is_email = 1; - if($from == '') { $from = "@from"; } + if($from == '') { $from = "@sender"; } $from .= " $v"; } else { diff --git a/webui/model/search/search.php b/webui/model/search/search.php index d2fecc85..74df3317 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -73,7 +73,7 @@ class ModelSearchSearch extends Model { $sd = preg_replace("/^\|/", "", $sd); - return " (@todomain $sd | @fromdomain $sd ) "; + return " (@todomain $sd | @senderdomain $sd ) "; } else { return ""; } @@ -82,7 +82,7 @@ class ModelSearchSearch extends Model { if(ENABLE_FOLDER_RESTRICTIONS == 1) { return ""; } $all_your_addresses = $this->get_all_your_address(); - return " (@from $all_your_addresses | @to $all_your_addresses) "; + return " (@sender $all_your_addresses | @to $all_your_addresses) "; } @@ -96,7 +96,7 @@ class ModelSearchSearch extends Model { $id = ""; $offset = 0; $total_sphx_hits = $num_rows = 0; - $fields = array("@(subject,body)", "@from", "@to", "@subject", "@body", "@attachment_types"); + $fields = array("@(subject,body)", "@sender", "@to", "@subject", "@body", "@attachment_types"); $pagelen = get_page_length(); @@ -128,7 +128,7 @@ class ModelSearchSearch extends Model { if(substr($v, 0, 1) == "@") { $v = substr($v, 1, strlen($v)-1); - if($data['match'][$i-1] == "@from") { $data['match'][$i-1] = "@fromdomain"; } + if($data['match'][$i-1] == "@sender") { $data['match'][$i-1] = "@senderdomain"; } if($data['match'][$i-1] == "@to") { $data['match'][$i-1] = "@todomain"; } } @@ -351,7 +351,7 @@ class ModelSearchSearch extends Model { while(list($k, $v) = each($b)) { if($v == '') { continue; } - if($v == 'from:') { $token = 'match'; $a['match'][] = '@from'; continue; } + if($v == 'from:') { $token = 'match'; $a['match'][] = '@sender'; continue; } else if($v == 'to:') { $token = 'match'; $a['match'][] = '@to'; continue; } else if($v == 'subject:') { $token = 'match'; $a['match'][] = '@subject'; continue; } else if($v == 'body:') { $token = 'match'; $a['match'][] = '@body'; continue; }