我在索引太阳能服务器中的文件索引代码。索引索尔文件索引时出错
** String urlString =“http://localhost:8080/solr”;
SolrServer solr = new CommonsHttpSolrServer(urlString); java.io.File file = new java.io.File(“C:\ Users \ Guruprasad \ Desktop \ Search \ 47975832.doc”); 如果(file.canRead()){
System.out.println("adding " + file);
try {
ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update/extract");
String parts[] = file.getName().split("\\.");
String type = "text";
if (parts.length>1) {
type = parts[1];
}
req.addFile(file);
req.setParam("literal.id", file.getAbsolutePath());
req.setParam("literal.name", file.getName());
req.setParam("literal.content_type", type);
req.setParam("uprefix", "attr_");
req.setParam("fmap.content", "attr_content");
req.setAction(ACTION.COMMIT, true, true);
solr.request(req);* //**Line no 36** here i am getting exception
而执行此代码我得到以下Exception.` 例外: org.apache.solr.common.SolrException 异常消息: 内部服务器错误内部服务器错误请求:http://localhost:8080/solr/update/extract?literal.id=C:\用户\古鲁普拉萨德\桌面\搜索\ 47975832.doc & literal.name = 47975832.doc & literal.content_type = DOC & uprefix = attr_ & fmap.content = attr_content &提交=真正& waitFlush =真& waitSearcher =真&重量= javabin &版本= 2 异常迹: 在org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:435) 在org.apache.solr.client。 solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:244) 在com.solr.search.test.IndexFiles.indexDocs(IndexFiles.java:36)*
任何帮助将是有益的