Extracts custom query keys from the index.

        Parameters which get extracted from the request:

            `q`: Passes the value to the `SearchableText`
            `path`: Creates a path query
            `recent_created`: Creates a date query
            `recent_modified`: Creates a date query

        :param catalog: The catalog to build the query for
        :type catalog: ZCatalog
        :returns: Catalog query
        :rtype: dict

def get_custom_query(self):
        """Extracts custom query keys from the index.

        Parameters which get extracted from the request:

            `q`: Passes the value to the `SearchableText`
            `path`: Creates a path query
            `recent_created`: Creates a date query
            `recent_modified`: Creates a date query

        :param catalog: The catalog to build the query for
        :type catalog: ZCatalog
        :returns: Catalog query
        :rtype: dict
        """
        query = {}

        # searchable text queries
        q = req.get_query()
        if q:
            query["SearchableText"] = q

        # physical path queries
        path = req.get_path()
        if path:
            query["path"] = {'query': path, 'depth': req.get_depth()}

        # special handling for recent created/modified
        recent_created = req.get_recent_created()
        if recent_created:
            date = api.calculate_delta_date(recent_created)
            query["created"] = {'query': date, 'range': 'min'}

        recent_modified = req.get_recent_modified()
        if recent_modified:
            date = api.calculate_delta_date(recent_modified)
            query["modified"] = {'query': date, 'range': 'min'}

        return query