castorqin commented on code in PR #9029: URL: https://github.com/apache/inlong/pull/9029#discussion_r1355978248
########## inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/cls/ClsResourceOperator.java: ########## @@ -136,14 +169,34 @@ private ClsClient getClsClient(ClsDataNodeDTO clsDataNode) { /** * Create topic index by tokenizer */ - private void createTopicIndex(SinkInfo sinkInfo) throws BusinessException { + private void createTopicIndex(SinkInfo sinkInfo, ClsDataNodeDTO clsDataNode) throws BusinessException { + ClsSinkDTO clsSinkDTO = JsonUtils.parseObject(sinkInfo.getExtParams(), ClsSinkDTO.class); - if (StringUtils.isNotBlank(clsSinkDTO.getTokenizer())) { - LOG.warn("topic {} tokenizer is empty", clsSinkDTO.getTopicName()); + if (StringUtils.isBlank(clsSinkDTO.getTokenizer())) { + LOG.warn("topic {} tokenizer is blank", clsSinkDTO.getTopicName()); + return; + } + FullTextInfo topicIndexFullText = getTopicIndexFullText(sinkInfo, clsDataNode); + if (ObjectUtils.anyNotNull(topicIndexFullText)) { + // if topic index exist,update + updateTopicIndex(sinkInfo, clsDataNode); return; } - ClsDataNodeDTO clsDataNode = getClsDataNode(sinkInfo); ClsClient clsClient = getClsClient(clsDataNode); + CreateIndexRequest req = getCreateIndexRequest(clsSinkDTO); + try { + clsClient.CreateIndex(req); Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org