Fix & polish code of SearchBundle
fix-2163 and others
Merge pull request #2170 from stloyd/bugfix/search

Fix & polish code of SearchBundle