Site Search in Arc Browser — For Your Own Site
Arc just released site search built right into the browser.
Want to search for something specifically on Twitter? Pull up the search bar and start typing Twitter
:
Select the site search option and hit Tab
. This puts you into what I’ll call “site search mode”:
Once you enter a query, you’ll be taken to that site’s search page with your query entered into the GUI — pretty neat!
As someone who uses site-specific search quite often on a search engine (e.g. in Google type “progressive enhancement site:adactio.com”) I thought this was cool.
If you’re wondering how it works under the hood, there’s some good documentation around it. What’s neat is: the feature is built on URLs. You can create a site-specific search that’s always one keystroke away in your browser by simply setting up a URL.
Back to my site-specific search example, I can now have adactio.com
on speed dial for search — a valid use case indeed.
Set up the site search in Arc, pass the %s
query param to Jeremy’s search page URL, and voilà !
https://adactio.com/search/?query=%s
Call me a narcissist, but I am constantly in need of searching my own blog for things I’ve written previously.
My blog, however, does not have a /search
endpoint that takes keywords and delivers results. In such cases, I often find myself formulating queries like this in a search engine:
deno webby site:blog.jim-nielsen.com
But wait a minute, I don’t have to go build a search page on my blog to use the site-specific search feature in Arc. I can leverage the URLs of a search engine like Google!
Setup in the %s
query, append the domain of the site you want to search, and voilĂ !
https://www.google.com/search?q=%s&as_sitesearch=blog.jim-nielsen.com
That gets you a site-specific search feature in Arc:
Which takes you to the search engine results:
I’m definitely going to use this a lot for searching my own stuff.
URLs FTW!
Update 2023-04-23
Chris published a great post expanding on the idea of site-specific search. It’s a good read for the history, but even better because he simplifies the URL you need for your own Google search. I was using the as_sitesearch
query param, but in Google’s search box you can just type site:example.com my query
so why not just use one query param and formulate your URL like you would a site search in Google? e.g.
https://www.google.com/search?q=site:blog.jim-nielsen.com+%s