mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Compare commits
3 commits
acbaf8f51a
...
63f8fbfeee
Author | SHA1 | Date | |
---|---|---|---|
|
63f8fbfeee | ||
|
f11512b580 | ||
|
1ae9a49811 |
1 changed files with 3 additions and 41 deletions
|
@ -268,47 +268,9 @@ class fulltext_sphinx implements search_backend_interface
|
|||
$this->sphinx->SetMatchMode(SPH_MATCH_ANY);
|
||||
}
|
||||
|
||||
// Split words
|
||||
$split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($keywords)));
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
|
||||
$this->split_words = $matches[1];
|
||||
|
||||
if ($terms == 'any')
|
||||
if (strlen($keywords) > 0)
|
||||
{
|
||||
$this->search_query = '';
|
||||
foreach ($this->split_words as $word)
|
||||
{
|
||||
if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0))
|
||||
{
|
||||
$word = substr($word, 1);
|
||||
}
|
||||
$this->search_query .= $word . ' ';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->search_query = '';
|
||||
foreach ($this->split_words as $word)
|
||||
{
|
||||
if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0))
|
||||
{
|
||||
$this->search_query .= $word . ' ';
|
||||
}
|
||||
else if (strpos($word, '|') === 0)
|
||||
{
|
||||
$this->search_query .= substr($word, 1) . ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->search_query .= '+' . $word . ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->search_query)
|
||||
{
|
||||
$this->search_query = str_replace('"', '"', $this->search_query);
|
||||
$this->search_query = str_replace('"', '"', $keywords);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -990,7 +952,7 @@ class fulltext_sphinx implements search_backend_interface
|
|||
array('read_timeout', '5'),
|
||||
array('max_children', '30'),
|
||||
array('pid_file', $this->config['fulltext_sphinx_data_path'] . 'searchd.pid'),
|
||||
array('binlog_path', $this->config['fulltext_sphinx_data_path']),
|
||||
array('binlog_path', rtrim($this->config['fulltext_sphinx_data_path'], '/\\')), // Trim trailing slash
|
||||
),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue