public static void update(String id, Object fieldValue) throws IOException, SolrServerException {
HashMap<String, Object> oper = new HashMap<String, Object>();
oper.put("set", fieldValue);
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", id);
doc.addField("fieldName", oper);
HttpSolrClient client = new HttpSolrClient(baseURL);
client.add(doc);
client.commit();
}
转载地址:http://blog.chinaunix.net/uid-79084-id-5098001.html