rewrite search