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

5

10

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.

Senaidasenalda answered 26/3, 2015 at 12:4 Comment(0)
B
5

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.

Bookish answered 26/3, 2015 at 12:9 Comment(4)
I have read that before I post my question and I guess this example is somehow different. The guy is not using SolarJ. And what he is trying to do is to rename to the default collection he is dealing with. For my case all I am trying to do is to index a certain document.Senaidasenalda
Please post your code then. Also, solrj is an API for talking to a solr instance from Java; they're not 2 different "types" of solr or anything...one's the client, one's the server. Also, you can view your solr cores here localhost:8983/solr/admin/cores?action=STATUS . The fact that you don't have a core in your url is still what I think the problem is.Bookish
In my case, the core went missing after solr was restarted, so had to create the core again and check the schema fileSentience
i am having the same problem, can anyone please help me out. My collection is getting embedd twice in the url, so it gives 404.=============== Problem accessing /solr/collectioName/collectioName/update.Janijania
S
3

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.

Seldan answered 28/9, 2018 at 11:15 Comment(0)
M
1

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 
Meacham answered 12/1, 2020 at 16:31 Comment(0)
S
0

I faced issue with hybris project and this helped:

INSERT_UPDATE SolrServerConfig ;name[unique=true];solrQueryMethod ;$serverConfigName; POST

Simferopol answered 30/1 at 14:55 Comment(0)
I
-2

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

Irrigation answered 13/2, 2017 at 16:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.