简体   繁体   中英

PySolr connection error 404

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.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM