Added search config

Added basic search configuration and improvements in search logic