Skip to content

Commit

Permalink
Merge pull request #145 from collective/fix-autocomplete
Browse files Browse the repository at this point in the history
autocomplete is GET not POST
  • Loading branch information
gforcada authored Sep 29, 2016
2 parents 3996efe + 4acffc6 commit 7d14fb5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/collective/solr/browser/suggest.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def __call__(self):
params['wt'] = 'json'

params = urllib.urlencode(params, doseq=True)
response = connection.doPost(
connection.solrBase + '/autocomplete?' + params, '', {})
url = connection.solrBase + '/autocomplete?' + params
response = connection.doGet(url, {})
results = json.loads(response.read())

if 'grouped' not in results:
Expand All @@ -88,5 +88,4 @@ def __call__(self):
result = []
for suggestion in suggestions:
result.append(dict(label=suggestion, value=suggestion))

return json.dumps(result)

0 comments on commit 7d14fb5

Please sign in to comment.