Search options/filters

First things first: the name attribute for your “All Words” checkbox shouldn’t be ‘s’. That replaces the search text with “1”, so when that’s checked, you’re searching for “1”, not for the search text.

I don’t think you want to use ‘exact’ if you’re looking to replicate the example you gave in your question.

Here’s an example:

Search for "Two Things" in titles and content:

Matches                   Does not match

"Two"                     "Two Things More"
"Things"                  "One or Two Things"
"Two Things"              "Two Things."

I could go on and on about what it won’t match, but you get the idea. This is probably why you are getting unexpected results.

Anyway, try changing the name of the ‘all words’ checkbox to something that won’t get matched, like 'fake_search_flag_name', since that flag is just describing WordPress’ normal default search capabilities anyway.

EDIT

Ok, now that they’re radios, here’s something you can do:

The first one is WordPress’ default behavior, so you need to make the VALUE empty:

<input type="radio" name="sentence" value="" checked="checked" /> All Words

If that box is checked, since the value is empty, WordPress will ignore it and use its default functionality. The next part is somewhat tricky. Change the values of the other two radios, something like this:

<input type="radio" name="sentence" value="or" /> Some Word<br />
<input type="radio" name="sentence" value="and" /> Entire phrase

In and of itself this will make them both behave the same way: the way you want ‘Entire Phrase’ to work. So we need to get ‘Some Word’ working. I haven’t tested this next part at all, but it should work.

We need to filter the search query to allow for the search terms to match posts that have some of the words but not all of them:

add_filter( 'posts_search', 'my_awesome_posts_search_filter' );

function my_awesome_posts_search_filter( $sql, $wpq ){
  if( !isset( $wpq->query_vars['sentence'] ) || 'or' != $wpq->query_vars['sentence'] )
    return $sql;
  $new_search = str_replace( ') AND (', ') OR (', $sql );
  return $new_search;
}

That should do it.

error code: 523