From c6fa09d8fc1bee577ebe82aa623a0f4f51795cf1 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 12 Sep 2022 09:27:02 +0300 Subject: [PATCH] Fix querying with include word filter from web interface - Not encoding the `query' string before querying the backend API with it was causing the "+" prefix for include word filter to be lost --- src/interface/web/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/interface/web/index.html b/src/interface/web/index.html index 09f23e27..ef84b38f 100644 --- a/src/interface/web/index.html +++ b/src/interface/web/index.html @@ -63,10 +63,10 @@ function search(rerank=false) { query = document.getElementById("query").value; type = document.getElementById("type").value; - console.log(query, type); + console.log(`Query: ${query}, Type: ${type}`); url = type === "image" - ? `/search?q=${query}&t=${type}&n=6` - : `/search?q=${query}&t=${type}&n=6&r=${rerank}`; + ? `/search?q=${encodeURIComponent(query)}&t=${type}&n=6` + : `/search?q=${encodeURIComponent(query)}&t=${type}&n=6&r=${rerank}`; fetch(url) .then(response => response.json()) .then(data => {