diff options
-rw-r--r-- | python/fatcat/search.py | 7 | ||||
-rw-r--r-- | python/fatcat/templates/release_search.html | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/python/fatcat/search.py b/python/fatcat/search.py index 959bb85f..0b038859 100644 --- a/python/fatcat/search.py +++ b/python/fatcat/search.py @@ -6,7 +6,7 @@ from fatcat import app def do_search(q, limit=20): - print("Search hit: " + q) + #print("Search hit: " + q) if limit > 100: # Sanity check limit = 100 @@ -35,12 +35,15 @@ def do_search(q, limit=20): abort(resp.status_code) content = resp.json() - print(content) + #print(content) results = [h['_source'] for h in content['hits']['hits']] for h in results: # Ensure 'contrib_names' is a list, not a single string if type(h['contrib_names']) is not list: h['contrib_names'] = [h['contrib_names'], ] + # TODO: a total hack; why is elastic sending weird surrogate + # characters? + h['contrib_names'] = [name.encode('utf8', 'ignore').decode('utf8') for name in h['contrib_names']] found = content['hits']['total'] return {"query": { "q": q }, diff --git a/python/fatcat/templates/release_search.html b/python/fatcat/templates/release_search.html index 1f78aaaf..800d550e 100644 --- a/python/fatcat/templates/release_search.html +++ b/python/fatcat/templates/release_search.html @@ -28,7 +28,6 @@ {% endif %} {% if paper.container_is_oa %}<i class="icon unlock orange small"></i>{% endif %} {% endif %} - <!-- <br>Date: {{ paper.release_date }} --> </div> {% else %} <br/> |