def setCatalog(catalog):
    """set the search index to be using the given catalog, return matches.

        Should immediately being index up-to-date if catalog has content.

        if index already has a catalog, raise an error.

        If provided catalog is None, clear catalog and indexes.

        Returned matches should be iterable of tuples of (search name or None,
        query names, static values, maxDepth, filter, queryFactory).  Only
        searches matching one of these tuples will be sent to the search
        index.
        """
