Add tests for search type and raise exception on invalid search type initialization

.