2
嗨我想索引使用彈簧引導數據solr solr中的實體。但我正在逐漸例外solr異常預期的MIME類型的應用程序/八位字節流,但得到了文本/ HTML
Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/portal: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/portal/publishers/update. Reason:
<pre> Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>
</body>
</html>
這是我的出版商類
@SolrDocument
public class Publishers {
@Id
@Field
private String advID;
@Field
private String name;
@Field
private String domain;
@Field("cat")
private String categories;
//getters and setters
}
我的倉庫接口
public interface BookRepository extends SolrCrudRepository<Publishers, String> {
List<Publishers> findByName(String name);
}
,我的基本網址爲:"http://localhost:8983/solr/portal"
。在我的主類代碼就像下面
@Resource
BookRepository repository;
@Override
public void run(String... strings) throws Exception {
this.repository.save(new Publishers("4", "Sony Playstation","none", null));
}
修訂 我觀察到實體類即Publishers
名稱自動附加到URL。我不知道如何告訴應用程序在向solr發送呼叫時不要在solr URL中追加名稱。 任何人都可以幫助我。在此先感謝
你何時何地得到那個異常? – Zeromus
當我保存我的發佈者請看我的run() –