A generator function that implements OpenSearch search queries and returns results

    All parameters for search are optional.

    :param tile_id: original tile identification string provided by ESA (e.g.
                    'S2A_OPER_MSI_L1C_TL_SGS__20160109T230542_A002870_T10UEV_N02.01')
    :type tile_id: str
    :param bbox: bounding box of requested area
    :type bbox: geometry.BBox
    :param start_date: beginning of time range in ISO8601 format
    :type start_date: str
    :param end_date: end of time range in ISO8601 format
    :type end_date: str
    :param absolute_orbit: An absolute orbit number of Sentinel-2 L1C products as defined by ESA
    :type absolute_orbit: int
    :return: An iterator returning dictionaries with info provided by Sentinel Hub OpenSearch REST service
    :rtype: Iterator[dict]

def search_iter(tile_id=None, bbox=None, start_date=None, end_date=None, absolute_orbit=None):
    """ A generator function that implements OpenSearch search queries and returns results

    All parameters for search are optional.

    :param tile_id: original tile identification string provided by ESA (e.g.
                    'S2A_OPER_MSI_L1C_TL_SGS__20160109T230542_A002870_T10UEV_N02.01')
    :type tile_id: str
    :param bbox: bounding box of requested area
    :type bbox: geometry.BBox
    :param start_date: beginning of time range in ISO8601 format
    :type start_date: str
    :param end_date: end of time range in ISO8601 format
    :type end_date: str
    :param absolute_orbit: An absolute orbit number of Sentinel-2 L1C products as defined by ESA
    :type absolute_orbit: int
    :return: An iterator returning dictionaries with info provided by Sentinel Hub OpenSearch REST service
    :rtype: Iterator[dict]
    """
    if bbox and bbox.crs is not CRS.WGS84:
        bbox = bbox.transform(CRS.WGS84)

    url_params = _prepare_url_params(tile_id, bbox, end_date, start_date, absolute_orbit)
    url_params['maxRecords'] = SHConfig().max_opensearch_records_per_query

    start_index = 1

    while True:
        url_params['index'] = start_index

        url = '{}search.json?{}'.format(SHConfig().opensearch_url, urlencode(url_params))
        LOGGER.debug("URL=%s", url)

        response = get_json(url)
        for tile_info in response["features"]:
            yield tile_info

        if len(response["features"]) < SHConfig().max_opensearch_records_per_query:
            break
        start_index += SHConfig().max_opensearch_records_per_query