Summary
Please add support for bangs: short shortcuts in the query, like !g, that send the search to another search engine instead of running it in Fess. For example, airplane !g would redirect to https://www.google.com/search?q=airplane.
The syntax and behavior should follow existing implementations, mainly DuckDuckGo’s bangs. Kagi and Brave Search already use the same convention, so users can switch between search engines without learning anything new.
Motivation
Fess is often deployed as the internal search, and many organizations set it as the browser’s default search engine. Users regularly need to search public sources too (the web, Wikipedia, vendor docs, package registries). Today that means leaving Fess, opening another engine and typing the query again.
Users who know DuckDuckGo, Kagi or Brave already type !g, !w and so on out of habit. If Fess understood the same syntax, it could serve as the default search engine with no loss of convenience. That makes Fess easier to adopt as the main entry point to company knowledge.
Proposed behavior (following DuckDuckGo)
- A bang is
!followed by a trigger (!g,!w,!gh), as a separate word anywhere in the query:!g airplane,airplane !gandfoo !g barall work. - If the query contains a known bang, Fess removes the bang, puts the rest of the query (URL-encoded) into the target URL template, and returns an HTTP redirect instead of a results page.
- Unknown bangs are left alone, and the query is searched in Fess as usual.
- Only the first recognized bang is used.
- A bang on its own with no other terms (e.g.
!g) redirects to the target’s homepage, as DuckDuckGo does.
Examples:
| Query | Result |
|---|---|
airplane !g |
Redirect to https://www.google.com/search?q=airplane |
!w Ohm's law |
Redirect to https://en.wikipedia.org/wiki/Special:Search?search=Ohm%27s%20law |
!g |
Redirect to https://www.google.com/ |
airplane !unknown |
Normal Fess search for airplane !unknown |
Configuration
- Add an admin page (similar to Key Match or Related Content) to manage bangs. Each entry has:
- a trigger (e.g.
g) - a URL template with a
{query}placeholder (e.g.https://www.google.com/search?q={query}) - a display name
- an enabled/disabled flag
- a trigger (e.g.
- Optionally ship a small default set (Google, Wikipedia, DuckDuckGo, GitHub, …) that admins can edit or disable.
- A global switch in the General settings to turn the feature on or off. It could default to off to keep current behavior.
Scope / open questions
It would apply to the web search UI (/search). For the JSON API (/api/v1/documents), it could either do nothing or return the resolved redirect URL in the response instead of results.
Current workaround
Bangs could be done in a reverse proxy in front of Fess (e.g. nginx rewriting /search?q=… requests). But that means maintaining URL-encoding-aware regexes outside Fess, and the feature can’t be discovered or configured from the Fess admin UI.