'solr exception Expected mime type application/octet-stream but got text/html
Hi I am trying to index an entity in solr using spring boot data solr. But i am getting exception
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>
This is my publisher class
@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
}
My repository interface
public interface BookRepository extends SolrCrudRepository<Publishers, String> {
List<Publishers> findByName(String name);
}
and my base URL is "http://localhost:8983/solr/portal"
. In my main class code is like below
@Resource
BookRepository repository;
@Override
public void run(String... strings) throws Exception {
this.repository.save(new Publishers("4", "Sony Playstation","none", null));
}
UPDATED
I have observed that the entity class i.e Publishers
name is automatically appending to the URL. I don't know how to tell application not to append the name in solr URL while sending a call to solr.
can anyone help me. Thanks in advance
Solution 1:[1]
You should annotate your solr document as @SolrDocument(solrCoreName="YOU_CORE_NAME")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | DrJunior |