public static void main(String[] args) throws Exception{
        HttpSolrClient server = new HttpSolrClient("http://");
        SolrInputDocument solrDoc = new SolrInputDocument();
        HashMap map = new HashMap();
        map.put("set","test2");

        solrDoc.addField("rowkey","row2");
        solrDoc.addField("BROWSER",map);

        server.add(solrDoc);
        server.commit();
        System.out.println("ok!");
    }
}

 

posted on 2018-07-13 09:29  充实自己  阅读(168)  评论(0编辑  收藏  举报