Пример #1
0
 def search(self):
     """Perform a search over the items."""
     hits = self.service.search(
         identity=g.identity,
         params=resource_requestctx.args,
         type=resource_requestctx.view_args["type"],
         es_preference=es_preference(),
     )
     return hits.to_dict(), 200
Пример #2
0
 def search_community_records(self):
     """Perform a search over the community's records."""
     hits = self.service.search_community_records(
         identity=g.identity,
         community_uuid=resource_requestctx.view_args["pid_value"],
         params=resource_requestctx.args,
         es_preference=es_preference(),
     )
     return hits.to_dict(), 200
Пример #3
0
    def search_user_communities(self):
        """Perform a search over the user's communities.

        GET /user/communities
        """
        hits = self.service.search_user_communities(
            identity=g.identity,
            params=resource_requestctx.args,
            es_preference=es_preference())
        return hits.to_dict(), 200
Пример #4
0
    def search_user_records(self):
        """Perform a search over the record's versions.

        GET /user/records
        """
        hits = self.service.search_drafts(
            identity=g.identity,
            params=resource_requestctx.args,
            es_preference=es_preference(),
        )
        return hits.to_dict(), 200
Пример #5
0
    def search_versions(self):
        """Perform a search over the record's versions.

        GET /records/:pid_value/versions
        """
        hits = self.service.search_versions(
            g.identity,
            resource_requestctx.view_args["pid_value"],
            params=resource_requestctx.args,
            es_preference=es_preference()
        )
        return hits.to_dict(), 200