made the search an 'AND' search (I think)
git-svn-id: http://svn.automattic.com/wordpress/trunk@367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
efcd47e994
commit
3bdc9c5bc2
|
@ -109,9 +109,9 @@ if (!empty($s)) {
|
|||
}
|
||||
if (!$sentence) {
|
||||
$s_array = explode(' ',$s);
|
||||
$search .= '(post_title LIKE \''.$n.$s_array[0].$n.'\') OR (post_content LIKE \''.$s_array[0].'\')';
|
||||
$search .= '((post_title LIKE \''.$n.$s_array[0].$n.'\') OR (post_content LIKE \''.$s_array[0].'\'))';
|
||||
for ( $i = 1; $i < count($s_array); $i = $i + 1) {
|
||||
$search .= ' OR (post_title LIKE \''.$n.$s_array[$i].$n.'\') OR (post_content LIKE \''.$n.$s_array[$i].$n.'\')';
|
||||
$search .= ' AND ((post_title LIKE \''.$n.$s_array[$i].$n.'\') OR (post_content LIKE \''.$n.$s_array[$i].$n.'\'))';
|
||||
}
|
||||
$search .= ' OR (post_title LIKE \''.$n.$s.$n.'\') OR (post_content LIKE \''.$n.$s.$n.'\')';
|
||||
$search .= ')';
|
||||
|
|
Loading…
Reference in New Issue