0

Is there a way to change the default search settings of the built in search module to default search to phrase match?

Phrase search as in by default terms would be searched with exact match:

"foo bar" over "foo" "bar"

The client doesn't seem to like the way the out of the box search works.

2
  • Using Drupal 6 or 7?
    – user842
    Aug 5, 2011 at 18:23
  • Good point. Drupal 6.
    – chrisjlee
    Aug 5, 2011 at 18:43

1 Answer 1

2

Even if it's kind of hacky you could do a hook_form_alter, set a submit function before the default one and look at the form input. Then wrap it with "" if it's not there already.

So what you need is

  • a custom module
  • hook_form_alter
  • Register a '#submit' function
  • Alter the value $form_state['values']

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.