Exemplo n.º 1
0
    def list_search_indexes(self):
        if not self.pb_search_admin():
            raise NotImplementedError("Yokozuna administration is not "
                                      "supported for this version")
        req = riak_pb.RpbYokozunaIndexGetReq()

        msg_code, resp = self._request(MSG_CODE_YOKOZUNA_INDEX_GET_REQ, req,
                               MSG_CODE_YOKOZUNA_INDEX_GET_RESP)

        return [self._decode_yz_index(index) for index in resp.index]
Exemplo n.º 2
0
    def get_search_index(self, index):
        if not self.pb_search_admin():
            raise NotImplementedError("Yokozuna administration is not "
                                      "supported for this version")
        req = riak_pb.RpbYokozunaIndexGetReq(name=index)

        msg_code, resp = self._request(MSG_CODE_YOKOZUNA_INDEX_GET_REQ, req,
                               MSG_CODE_YOKOZUNA_INDEX_GET_RESP)
        if len(resp.index) > 0:
            return self._decode_yz_index( resp.index[0] )
        else:
            raise RiakError('notfound')