Skip to content

SolrError: Solr responded with an error (HTTP 400): [Reason: TaggerRequestHandler requires text to be POSTed to it] #282

Open
@akurniawan

Description

@akurniawan

I have

  • Tested with the latest release
  • Tested with the current master branch
  • Searched for similar existing issues

Expected behaviour

Able to request to Solr server and getting response

Actual behaviour

Getting error as follows

---------------------------------------------------------------------------
SolrError                                 Traceback (most recent call last)
<ipython-input-28-e8db800b73ab> in <module>
      4     "fl": "id,name,countrycode",
      5     "wt": "json",
----> 6     "indent": "on"
      7 })
      8 

/anaconda2/envs/us-entity/lib/python3.6/site-packages/pysolr.py in search(self, q, search_handler, **kwargs)
    740         params = {'q': q}
    741         params.update(kwargs)
--> 742         response = self._select(params, handler=search_handler)
    743         decoded = self.decoder.decode(response)
    744 

/anaconda2/envs/us-entity/lib/python3.6/site-packages/pysolr.py in _select(self, params, handler)
    435             # Typical case.
    436             path = '%s/?%s' % (handler, params_encoded)
--> 437             return self._send_request('get', path)
    438         else:
    439             # Handles very long queries by submitting as a POST.

/anaconda2/envs/us-entity/lib/python3.6/site-packages/pysolr.py in _send_request(self, method, path, body, headers, files)
    410                                            'request_body': bytes_body,
    411                                            'request_headers': headers}})
--> 412             raise SolrError(error_message % (resp.status_code, solr_message))
    413 
    414         return force_unicode(resp.content)

SolrError: Solr responded with an error (HTTP 400): [Reason: TaggerRequestHandler requires text to be POSTed to it]

Steps to reproduce the behaviour

  1. Follow the steps in https://lucene.apache.org/solr/guide/7_4/the-tagger-handler.html#tutorial-with-geonames
  2. Run the following code
import pysolr
solr = pysolr.Solr('http://localhost:[port]/solr/geonames')
results = solr.search('New York City', search_handler="/tag", **{
    "overlaps": "NO_SUB",
    "tagsLimit": 5000,
    "fl": "id,name,countrycode",
    "wt": "json",
    "indent": "on"
})

Configuration

  • Operating system version: Ubuntu 16.04
  • Search engine version: 7.5
  • Python version: 3.6
  • pysolr version: 3.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions