当前位置: 代码迷 >> J2SE >> solr 删除索引总是报错的有关问题
  详细解决方案

solr 删除索引总是报错的有关问题

热度:10537   发布时间:2013-02-25 00:00:00.0
solr 删除索引总是报错的问题
其代码:
solrServer.deleteById("2");
solrServer.commit();

程序一运行到红色部分,就报错其错误提示是:

org.apache.solr.common.SolrException: Not Found

Not Found

request: http://localhost:8080/solr/core1/update/javabin?wt=javabin&version=1
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:435)
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:244)
at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:102)
at com.test.solr.SolrDelList.main(SolrDelList.java:37)
请问下,这是什么错误哦?


------解决方案--------------------------------------------------------
你应该捕一下异常
------解决方案--------------------------------------------------------
例如:schema.xml中配置的<uniqueKey>id</uniqueKey>
solrServer.deleteById("id:2");
solrServer.commit();
再试试。

  相关解决方案