[SMB] Refactored search sql builders to have less duplication

[SMB] removed some not needed comments