Пример #1
0
    def process_query(self, doc):
        """
        Processes the Saved Search document
        """

        if not doc['filter'].get('query'):
            raise SuperdeskApiError.badRequestError('Search cannot be saved without a filter!')

        return self.get_location(doc), build_elastic_query(
            {k: v for k, v in doc['filter']['query'].items() if k != 'repo'})
Пример #2
0
    def process_query(self, doc):
        """
        Processes the Saved Search document
        """

        if not doc['filter'].get('query'):
            raise SuperdeskApiError.badRequestError('Fail to validate the filter.')

        return self.get_location(doc), build_elastic_query(
            {k: v for k, v in doc['filter']['query'].items() if k != 'repo'})
Пример #3
0
    def process_query(self, doc):
        """
        Processes the Saved Search document
        """

        if not doc["filter"].get("query"):
            raise SuperdeskApiError.badRequestError(
                _("Search cannot be saved without a filter!"))

        return self.get_location(doc), build_elastic_query(
            {k: v
             for k, v in doc["filter"]["query"].items() if k != "repo"})