mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 16:14:21 +00:00
Update web interface to allow querying all content types at once
This commit is contained in:
parent
5c7c8d1f46
commit
d5fb4196de
1 changed files with 7 additions and 3 deletions
|
@ -94,9 +94,12 @@
|
||||||
setQueryFieldInUrl(query);
|
setQueryFieldInUrl(query);
|
||||||
|
|
||||||
// Generate Backend API URL to execute Search
|
// Generate Backend API URL to execute Search
|
||||||
url = type === "image"
|
if (type == 'all')
|
||||||
? `/api/search?q=${encodeURIComponent(query)}&t=${type}&n=${results_count}&client=web`
|
url = `/api/search?q=${encodeURIComponent(query)}&n=${results_count}&client=web`;
|
||||||
: `/api/search?q=${encodeURIComponent(query)}&t=${type}&n=${results_count}&r=${rerank}&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
|
// Execute Search and Render Results
|
||||||
fetch(url)
|
fetch(url)
|
||||||
|
@ -138,6 +141,7 @@
|
||||||
fetch("/api/config/types")
|
fetch("/api/config/types")
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(enabled_types => {
|
.then(enabled_types => {
|
||||||
|
enabled_types.push("all");
|
||||||
document.getElementById("type").innerHTML =
|
document.getElementById("type").innerHTML =
|
||||||
enabled_types
|
enabled_types
|
||||||
.map(type => `<option value="${type}">${type.slice(0,1).toUpperCase() + type.slice(1)}</option>`)
|
.map(type => `<option value="${type}">${type.slice(0,1).toUpperCase() + type.slice(1)}</option>`)
|
||||||
|
|
Loading…
Add table
Reference in a new issue