Index: search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.241 diff -u -r1.241 search.module --- search.module 13 Nov 2007 14:04:08 -0000 1.241 +++ search.module 28 Nov 2007 12:16:09 -0000 @@ -710,7 +710,7 @@ // Classify tokens $or = FALSE; - $or_warning = FALSE; + $warning = ''; $simple = TRUE; foreach ($matches as $match) { $phrase = FALSE; @@ -740,10 +740,16 @@ $or = TRUE; continue; } + // AND operator: implied, so just ignore it + elseif ($match[2] == 'AND' || $match[2] == 'and') { + $warning = $match[2]; + continue; + } + // Plain keyword else { if ($match[2] == 'or') { - $or_warning = TRUE; + $warning = $match[2]; } if ($or) { // Add to last element (which is an array) @@ -814,7 +820,7 @@ // Build word-index conditions for the first pass $query2 = substr(str_repeat("i.word = '%s' OR ", count($arguments2)), 0, -4); - return array($query, $arguments, $query2, $arguments2, $matches, $simple, $or_warning); + return array($query, $arguments, $query2, $arguments2, $matches, $simple, $warning); } /** @@ -901,7 +907,9 @@ form_set_error('keys', t('You must include at least one positive keyword with @count characters or more.', array('@count' => variable_get('minimum_word_size', 3)))); } if ($query[6]) { - form_set_error('keys', t('Try uppercase "OR" to search for either of two terms.')); + if ($query[6] == 'or') { + form_set_error('keys', t('Search for either of the two terms with an uppercase "OR"
for example, cats OR dogs')); + } } if ($query === NULL || $query[0] == '' || $query[2] == '') { return array();