mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 05:40:17 +00:00
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
This commit is contained in:
@@ -63,10 +63,10 @@
|
|||||||
function search(rerank=false) {
|
function search(rerank=false) {
|
||||||
query = document.getElementById("query").value;
|
query = document.getElementById("query").value;
|
||||||
type = document.getElementById("type").value;
|
type = document.getElementById("type").value;
|
||||||
console.log(query, type);
|
console.log(`Query: ${query}, Type: ${type}`);
|
||||||
url = type === "image"
|
url = type === "image"
|
||||||
? `/search?q=${query}&t=${type}&n=6`
|
? `/search?q=${encodeURIComponent(query)}&t=${type}&n=6`
|
||||||
: `/search?q=${query}&t=${type}&n=6&r=${rerank}`;
|
: `/search?q=${encodeURIComponent(query)}&t=${type}&n=6&r=${rerank}`;
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|||||||
Reference in New Issue
Block a user