commit 892b841f86d93848d5d9cfa7c497706fca6d1c84
parent b6367fb928021ad1f62b88e863c461f7a729ae22
Author: Natalie Pendragon <natpen@natpen.net>
Date: Thu, 16 Apr 2020 18:40:13 -0400
[serve] Fix bug in displaying "input" results
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gus/serve.py b/gus/serve.py
@@ -69,7 +69,7 @@ def _search_index(query):
results = searcher.search(query)
return (
len(results),
- [(result.score, result["url"], result["content_type"]) for result in results]
+ [(result.score, result["url"], result["content_type"], result["prompt"] if "prompt" in result else "") for result in results]
)
@@ -99,7 +99,7 @@ def _render_results(results):
data.append("")
prompt_suffix = ""
if result[2] == "input":
- prompt_suffix = ": {}".format(result[4])
+ prompt_suffix = ": {}".format(result[3])
data.append("=> {}".format(result[1]))
data.append("{}{} (score: {:.2f})".format(result[2], prompt_suffix, result[0]))
return data