Indexing documents using Solr results in Expected mime type application/octet-stream but got text/html

∥☆過路亽.° 提交于 2020-01-24 18:03:37

问题


What I am trying to do is to index document using Solr.

I have installed and started Solr server on a Windows environment and I am trying to index using SolrJ.

However when I try to add the solr document to the server as shown below it results in the an error

server.add(indexDoc);

Error

Error from server at http://localhost:8983/solr: Expected mime type application/octet-stream but got text/html

<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/update. Reason:
<pre>    Not Found</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>

What would be the possible reason for this issue.


回答1:


I think the 404 error is more relevant to your problem... See this: Error 404: Prob accessing /solr/update. Reason: Not Found

You're missing your collection name in the URL.




回答2:


In my case it was because the Core was not there which I have specified here @SolrDocument(solrCoreName = "documents") There should be a core with the name documents present on the server.

So I created the core from the command line on windows using the following command bin/solr.cmd create -c documents -p 8983.

Then it worked in my case.




回答3:


In my case core was missing. Create the nutch core using following command:

${APACHE_SOLR_HOME}/bin/solr create -c nutch -d ${APACHE_SOLR_HOME}/server/solr/configsets/nutch/conf/

Also, check the status of core by:

localhost:8983/solr/admin/cores?action=STATUS 



回答4:


Check your field names in Collection and Application they are mismatched.



来源:https://stackoverflow.com/questions/29277972/indexing-documents-using-solr-results-in-expected-mime-type-application-octet-st

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!