def _do_search_by_product(self, query, return_fields=False, with_source_ids=False):
    for (q, dataset_type) in self._get_product_queries(query):
        dataset_fields = dataset_type.metadata_type.dataset_fields
        query_exprs = tuple(fields.to_expressions(dataset_fields.get, **q))
        select_fields = None
        if return_fields:
            select_fields = tuple(dataset_fields.values())
        (yield (dataset_type, self._db.search_datasets(query_exprs, select_fields=select_fields, with_source_ids=with_source_ids)))
def _do_search_by_product(self, query, return_fields=False, with_source_ids=False):
    for (q, dataset_type) in self._get_product_queries(query):
        dataset_fields = dataset_type.metadata_type.dataset_fields
        query_exprs = tuple(fields.to_expressions(dataset_fields.get, **q))
        select_fields = None
        if return_fields:
            select_fields = tuple(dataset_fields.values())
        (yield (dataset_type, self._db.search_datasets(query_exprs, select_fields=select_fields, with_source_ids=with_source_ids)))