Refactor #4449 Improve search functionality

http://tracker.modx.com/issues/4449