diff options
author | Dhruv <dhruv.goel92@gmail.com> | 2014-03-08 21:44:30 +0530 |
---|---|---|
committer | Dhruv <dhruv.goel92@gmail.com> | 2014-03-08 21:44:30 +0530 |
commit | 3b6d37131025f04caf998c26316497ebd4a37a4d (patch) | |
tree | 768d0b3b59bc24b6bf3aaef3fc388b7459c20eb9 /phpBB/phpbb | |
parent | 9100f4ebbfba9a4eb7a91e545bf85a3982ffc0dd (diff) | |
parent | c51dcbe6a0cd6e15456ac80b2bdfe13d94f27f07 (diff) | |
download | forums-3b6d37131025f04caf998c26316497ebd4a37a4d.tar forums-3b6d37131025f04caf998c26316497ebd4a37a4d.tar.gz forums-3b6d37131025f04caf998c26316497ebd4a37a4d.tar.bz2 forums-3b6d37131025f04caf998c26316497ebd4a37a4d.tar.xz forums-3b6d37131025f04caf998c26316497ebd4a37a4d.zip |
Merge branch 'ticket/10945' into ticket/10945-develop
* ticket/10945:
[ticket/10945] Fix return values for split_keywords function
[ticket/10945] Display search query when search fails in native search
[ticket/10945] remove trigger_error call
Conflicts:
phpBB/phpbb/search/fulltext_native.php
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/search/fulltext_native.php | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 1a89182978..fb3726c957 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -325,7 +325,6 @@ class fulltext_native extends \phpbb\search\base } $this->db->sql_freeresult($result); } - unset($exact_words); // now analyse the search query, first split it using the spaces $query = explode(' ', $keywords); @@ -451,39 +450,21 @@ class fulltext_native extends \phpbb\search\base $this->{$mode . '_ids'}[] = $words[$word]; } } - // throw an error if we shall not ignore unexistant words - else if (!$ignore_no_id) + else { if (!isset($common_ids[$word])) { $len = utf8_strlen($word); - if ($len >= $this->word_length['min'] && $len <= $this->word_length['max']) - { - trigger_error(sprintf($this->user->lang['WORD_IN_NO_POST'], $word)); - } - else + if ($len < $this->word_length['min'] || $len > $this->word_length['max']) { $this->common_words[] = $word; } } } - else - { - $len = utf8_strlen($word); - if ($len < $this->word_length['min'] || $len > $this->word_length['max']) - { - $this->common_words[] = $word; - } - } } - // we can't search for negatives only - if (!sizeof($this->must_contain_ids)) - { - return false; - } - - if (!empty($this->search_query)) + // Return true if all words are not common words + if (sizeof($exact_words) - sizeof($this->common_words) > 0) { return true; } @@ -518,6 +499,12 @@ class fulltext_native extends \phpbb\search\base return false; } + // we can't search for negatives only + if (empty($this->must_contain_ids)) + { + return false; + } + $must_contain_ids = $this->must_contain_ids; $must_not_contain_ids = $this->must_not_contain_ids; $must_exclude_one_ids = $this->must_exclude_one_ids; |