Function for preparing search parameters done