Rewrite to support non-blocking search