def make_search_string(arg_dict):
    """Create search string that will be used to query observation tables

    Parameters
    ----------
    arg_dict: dict
        dictionary with the search arguments. They are as follows: 'exposure': Image name,
        'skycell': Skycell name, 'config': Instrument/Detector name (Uppercase, separated by a "/"
        (e.g. WFC3/IR)), 'spec': Filter name. lowercase.

    Returns
    -------
    search_string : str
        Properly formatted search string
    """
    search_string = ""
    for item in arg_dict:
        if not arg_dict[item] or item is "date_range":
            continue
        if item is "skycell":
            substring = "{} == '{}'".format(item, arg_dict[item])
        elif item is "spec":
            parse_spec = arg_dict[item].split("-")
            substring = "{}.str.contains('{}')".format(item, parse_spec[0])
            if len(parse_spec) == 2:  # Search for two-filter observations (ACS)
                substring = "{} and {}.str.contains('{}')".format(substring, item, parse_spec[1])
        else:
            substring = "{}.str.contains('{}')".format(item, arg_dict[item])
        if len(search_string) == 0:
            query_delimiter = ""
        else:
            query_delimiter = " and "
        search_string = "{}{}{}".format(search_string, query_delimiter, substring)
    return search_string