fixes #5235: it's impossible to create filters with invaid searches

and as of e07f9a1, assert_valid and friends