[GH-ISSUE #5722] SearXNG search query is double encoded #5257

Closed
opened 2026-06-05 14:52:58 -04:00 by yindo · 0 comments
Owner

Originally created by @trick77 on GitHub (May 30, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5722

SearXNG searches seem to be double encoding the query.

Example query:

Colossus and the Crab ending D.F. Jones book 3 plot summary

gets sent as:

/search?q=Colossus%2520and%2520the%2520Crab%2520ending%2520D.F.%2520Jones%2520book%25203%2520plot%2520summary&format=json

So SearXNG receives Colossus%20and%20... as the query instead of normal text.

Looks like this line is the cause:

searchURL.searchParams.append("q", encodeURIComponent(query));

URLSearchParams already handles encoding, so passing query directly fixes it:

searchURL.searchParams.append("q", query);

I monkeypatched this locally and it resolves the issue, but I’d rather not carry that patch in my deployment.

Originally created by @trick77 on GitHub (May 30, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5722 SearXNG searches seem to be double encoding the query. Example query: ```text Colossus and the Crab ending D.F. Jones book 3 plot summary ``` gets sent as: ```text /search?q=Colossus%2520and%2520the%2520Crab%2520ending%2520D.F.%2520Jones%2520book%25203%2520plot%2520summary&format=json ``` So SearXNG receives `Colossus%20and%20...` as the query instead of normal text. Looks like this line is the cause: ```js searchURL.searchParams.append("q", encodeURIComponent(query)); ``` `URLSearchParams` already handles encoding, so passing `query` directly fixes it: ```js searchURL.searchParams.append("q", query); ``` I monkeypatched this locally and it resolves the issue, but I’d rather not carry that patch in my deployment.
yindo closed this issue 2026-06-05 14:52:58 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5257