我在索引太陽能服務器中的文件索引代碼。索引索爾文件索引時出錯
** 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)*
任何幫助將是有益的