2

I am using solrv5.0 and pysolr but I get the following traceback when I run a python script:

File "site-packages/pysolr.py", line 322, in _send_request
raise SolrError(error_message)
pysolr.SolrError: [Reason: Error 404 Not Found

For the script lines about pySolr, I only have:

solr = pysolr.Solr('http://localhost:8983/solr/', timeout=10)
solr.add([dict])

where dict is a python dictionnary. When I comment # solr.add, I haven't got any errors. So I think I get the connection but I can't update... Why? Thanks for your help.

mathieu
  • 53
  • 7
  • Open `site-packages/pysolr.py` as read-only in a text editor, go to line 322, and see which file `_send_request()` is trying to use. May give you a nudge in the right direction. – boardrider Apr 26 '15 at 13:25
  • I have this:if int(resp.status_code) != 200: error_message = self._extract_error(resp) self.log.error(error_message, extra={'data': {'headers': resp.headers, 'response': resp.content}}) raise SolrError(error_message) – mathieu Apr 27 '15 at 09:43
  • Sorry for the bad comment above, it has been edited too much quickly. But this don't give me a nudge for this error... I think. – mathieu Apr 27 '15 at 09:54
  • Look at the lines prior to `if int(resp.status_code) != 200` which causes the `if` stanza to be activated. These lines should tell you which file failed to be found, causing the 404 error. – boardrider Apr 27 '15 at 10:21

1 Answers1

2

I needed to specify my solr core to get this command to work.

This:

solr = pysolr.Solr('http://localhost:8983/solr/', timeout=10)

Should be:

solr = pysolr.Solr('http://localhost:8983/solr/your_core_name', timeout=10)

codeMonkey
  • 410
  • 1
  • 5
  • 13