From e118e4c785b769d8b179c13533bea3a3ced43c9a Mon Sep 17 00:00:00 2001
From: Dennis <2rupnow@informatik.uni-hamburg.de>
Date: Thu, 11 Apr 2019 11:03:00 +0200
Subject: [PATCH] .

---
 ckanext/odsh/fanstatic/autocomplete.js | 9 +++++----
 ckanext/odsh/logic/action.py           | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ckanext/odsh/fanstatic/autocomplete.js b/ckanext/odsh/fanstatic/autocomplete.js
index f5647ace..d03b158f 100644
--- a/ckanext/odsh/fanstatic/autocomplete.js
+++ b/ckanext/odsh/fanstatic/autocomplete.js
@@ -4,6 +4,9 @@ $(function () {
 
   // Activate search suggestions for the search bar in the header and for the
   // search bar used in the body.
+
+
+})
   $('.site-search input, .search').autocomplete({
     delay: 500,
     html: true,
@@ -13,9 +16,7 @@ $(function () {
       $.getJSON(url, {q: request.term})
         .done(function (data) {
           console.log(data);
-          response(data);
+          response(data.result.spellcheck.suggestions[1].suggestion);
         });
       }
-  });
-
-})
+  });
\ No newline at end of file
diff --git a/ckanext/odsh/logic/action.py b/ckanext/odsh/logic/action.py
index 9dad1287..98bd5526 100644
--- a/ckanext/odsh/logic/action.py
+++ b/ckanext/odsh/logic/action.py
@@ -53,5 +53,5 @@ def autocomplete(context, data_dict):
         raise SearchError('SOLR returned an error running query: %r Error: %r' %
                           (query, e))
 
-    suggest = solr_response.raw_response.get('spellcheck')
+    suggest = solr_response.raw_response
     return suggest
-- 
GitLab