Implemented new search behavior (fixed #1549)
Fixes and nits
Merged
Moved comments
Merge pull request #1639 from dinhviethoa/1549-search-behavior

Implemented new search behavior (fixed #1549)