zoukankan      html  css  js  c++  java
  • 通过Solrj实现对索引库中数据的局部更新操作

        for (UpdateIndexDTO updateIndexDTO : data) {
                    
                    // 局部更新
                    SolrInputDocument doc = new SolrInputDocument();
                    bibGid = updateIndexDTO.getBibGid();
                    doc.addField("gid", bibGid);
                    String bookSummary = updateIndexDTO.getBookSummary();
                    String bookContents = updateIndexDTO.getBookContents();
    //                System.out.println(bookContents.getBytes().length);
                    Map<String, String> bookSummaryMap = new HashMap<String, String>();
                    Map<String, String> bookContentsMap = new HashMap<String, String>();
                    bookSummaryMap.put("set", bookSummary);
                    bookContentsMap.put("set", bookContents);
                    
                    doc.addField("bookSummary", bookSummaryMap);
                    doc.addField("bookContents", bookContentsMap);
                    
                    docs.add(doc);
                }
                
                try {
                    if(docs.size()>0){
                    UpdateResponse updateResponse = solrServer.add(docs);
                    System.out.println("updateResponse=" + updateResponse);
                    }

    百度云盘链接:http://pan.baidu.com/s/1nvDIeXN

  • 相关阅读:
    C/C++ 库函数 是否调用 WinAPI
    获得图形的实际坐标值
    电影
    adobe flash player 下载地址
    加速软件
    电影_排行榜
    transform
    MyEclipse
    Android
    AAA
  • 原文地址:https://www.cnblogs.com/xufan/p/6445180.html
Copyright © 2011-2022 走看看