From d5fb4196de3afefd04c72c68d2d7b121d5e88005 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 20 Jun 2023 20:19:15 -0700 Subject: [PATCH] Update web interface to allow querying all content types at once --- src/khoj/interface/web/index.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/khoj/interface/web/index.html b/src/khoj/interface/web/index.html index 51412d75..78b24d56 100644 --- a/src/khoj/interface/web/index.html +++ b/src/khoj/interface/web/index.html @@ -94,9 +94,12 @@ setQueryFieldInUrl(query); // Generate Backend API URL to execute Search - url = type === "image" - ? `/api/search?q=${encodeURIComponent(query)}&t=${type}&n=${results_count}&client=web` - : `/api/search?q=${encodeURIComponent(query)}&t=${type}&n=${results_count}&r=${rerank}&client=web`; + if (type == 'all') + url = `/api/search?q=${encodeURIComponent(query)}&n=${results_count}&client=web`; + else if (type === "image") + url = `/api/search?q=${encodeURIComponent(query)}&t=${type}&n=${results_count}&client=web`; + else + url = `/api/search?q=${encodeURIComponent(query)}&t=${type}&n=${results_count}&r=${rerank}&client=web`; // Execute Search and Render Results fetch(url) @@ -138,6 +141,7 @@ fetch("/api/config/types") .then(response => response.json()) .then(enabled_types => { + enabled_types.push("all"); document.getElementById("type").innerHTML = enabled_types .map(type => ``)