def word_seg_list(self,protobufs): res = [] if not check_list(protobufs): LOG.info("Do Not Call Word Segging,For the input list is:%s"%(protobufs)) return res try: self.transport.open() LOG.info("Begin RPC Word Segging,[%s] To Be Segged!" %(len(protobufs))) res = self.client.word_seg_list(protobufs) self.transport.close() LOG.info("Finish RPC Word Segging,[%s] Entrys Have Been Segged!" %(len(res))) self.rec_protobuf(res) except Exception,e: LOG.error(e)
def index_list_string(self, protobufs): if not check_list(protobufs): LOG.info("Do Not Call Indexing, For the input list is:%s" % (protobufs)) return count = 0 try: self.transport.open() is_ready = self.start_index() if not is_ready: LOG.error("Index Server Is Not Ready!") return 0 count = self.client.put_list_string(protobufs) LOG.info("[%s] Entrys Has Been Successfully Indexed." % (count)) self.stop_index() self.transport.close() except Exception, e: LOG.error(e)