Apache Solr索引富文本(html word pdf)(7)
日期:2011-11-02
点击:196
来源: 未知
分享至:
public static void indexFilesSolrCell(String fileName, String solrId)
throws IOException, SolrServerException {
String urlString = \"http://localhost:8080/solr\";
SolrServer solr = new CommonsHttpSolrServer(urlString);
ContentStreamUpdateRequest up
= new ContentStreamUpdateRequest(\"/update/extract\");
up.addFile(new File(fileName));
up.setParam(\"literal.id\", solrId);
up.setParam(\"fmap.content\", \"attr_content\");