mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 20:40:13 +01:00
you can search for can't or don't too, words with single quotes
This commit is contained in:
parent
7de23a3b1d
commit
4d4982a9c6
@ -232,11 +232,13 @@ class ModelSearchSearch extends Model {
|
|||||||
$match = $this->assemble_email_address_condition($data['from'], $data['to']);
|
$match = $this->assemble_email_address_condition($data['from'], $data['to']);
|
||||||
|
|
||||||
if($data['body']) {
|
if($data['body']) {
|
||||||
|
$data['body'] = $this->fixup_meta_characters($data['body']);
|
||||||
$data['body'] = $this->fixup_sphinx_operators($data['body']);
|
$data['body'] = $this->fixup_sphinx_operators($data['body']);
|
||||||
if($match) { $match .= " & "; } $match .= "(@body " . $data['body'] . ") ";
|
if($match) { $match .= " & "; } $match .= "(@body " . $data['body'] . ") ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($data['subject']) {
|
if($data['subject']) {
|
||||||
|
$data['subject'] = $this->fixup_meta_characters($data['subject']);
|
||||||
$data['subject'] = $this->fixup_sphinx_operators($data['subject']);
|
$data['subject'] = $this->fixup_sphinx_operators($data['subject']);
|
||||||
if($match) { $match .= " & "; } $match .= "(@subject " . $data['subject'] . ") ";
|
if($match) { $match .= " & "; } $match .= "(@subject " . $data['subject'] . ") ";
|
||||||
}
|
}
|
||||||
@ -245,6 +247,7 @@ class ModelSearchSearch extends Model {
|
|||||||
|
|
||||||
|
|
||||||
if($data['any']) {
|
if($data['any']) {
|
||||||
|
$data['any'] = $this->fixup_meta_characters($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 .= "(@subject,@body" . $data['any'] . ") ";
|
if($match) { $match = "($match) & "; } $match .= "(@subject,@body" . $data['any'] . ") ";
|
||||||
@ -645,6 +648,15 @@ class ModelSearchSearch extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function fixup_meta_characters($s = '') {
|
||||||
|
if($s == '') { return $s; }
|
||||||
|
|
||||||
|
$s = preg_replace("/\'/", ' ', $s);
|
||||||
|
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private function fixup_sphinx_operators($s = '') {
|
private function fixup_sphinx_operators($s = '') {
|
||||||
if($s == '') { return $s; }
|
if($s == '') { return $s; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user