Tune dynamic bucket mode according to search state.

- When entering page search, disable dynamic bucket mode
- When leaveing page search, enable dynamic bucket mode

Fixes #790.