Fix two issues.

1. Support the actionSearch on the view.
2. Fix the empty string search leads crash.