Misc test index fix
refactor search function
Add test for using columns that does not exist