SolrException: HTTP code=404, reason=Not Found

222 views
Skip to first unread message

rajkumar kandasamy

unread,
Sep 3, 2015, 4:19:50 AM9/3/15
to solrpy
In [1]: import solr

In [2]: s = solr.SolrConnection('http://localhost:8983/solr')

In [3]: s.add(id=1, title='Lucene in Action', author=['Erik Hatcher', 'Otis Gospodneti'])

in this code i am getting the following error. help me pls ..

error :

SolrException                             Traceback (most recent call last)
<ipython-input-3-4aeb4f516f2a> in <module>()
----> 1 s.add(id=1, title='Lucene in Action', author=['Erik Hatcher', 'Otis Gospodneti'])

/home/rajkumar/anaconda/lib/python2.7/site-packages/solr/core.pyc in add(self, _commit, **fields)
    677         This is equialent to ``solr.Solr.add(fields, commit=_commit)``.
    678         """
--> 679         return Solr.add_many(self, [fields], commit=_commit)
    680 
    681     def add_many(self, docs, _commit=False):

/home/rajkumar/anaconda/lib/python2.7/site-packages/solr/core.pyc in wrapper(self, *args, **kw)
    324         content = function(self, *args, **kw)
    325         if content:
--> 326             return self._update(content, query)
    327         # If there's nothing to do (no content), should we issue a
    328         # commit/optimize if those are requested by the options?

/home/rajkumar/anaconda/lib/python2.7/site-packages/solr/core.pyc in _update(self, request, query)
    549         selector = '%s/update%s' % (self.path, qs_from_items(query))
    550         try:
--> 551             rsp = self._post(selector, request, self.xmlheaders)
    552             data = rsp.read()
    553         finally:

/home/rajkumar/anaconda/lib/python2.7/site-packages/solr/core.pyc in _post(self, url, body, headers)
    638             try:
    639                 self.conn.request('POST', url, body.encode('UTF-8'), _headers)
--> 640                 return check_response_status(self.conn.getresponse())
    641             except (socket.error,
    642                     httplib.ImproperConnectionState,

/home/rajkumar/anaconda/lib/python2.7/site-packages/solr/core.pyc in check_response_status(response)
   1101         except:
   1102             pass
-> 1103         raise ex
   1104     return response
   1105 

SolrException: HTTP code=404, reason=Not Found

Felipe Loyola

unread,
Sep 16, 2015, 2:52:03 PM9/16/15
to solrpy
don't you have a core ?

I think it's have to be "s = solr.SolrConnection('http://localhost:8983/solr/yourCore')"
Reply all
Reply to author
Forward
0 new messages