4 ms·
I use my own server for search. I just had to add an OpenSearch xml file. https://developer.mozilla.org/en-US/docs/Web/OpenSearch https://developer.mozilla.org
by nefitty 5y ago
I use my own server for search. I just had to add an OpenSearch xml file.
https://developer.mozilla.org/en-US/docs/Web/OpenSearch https://developer.mozilla.org/en-US/docs/Web/OpenSearch
- jedwhite 5y agoThe OpenSearch standard is great and definitely an improvement where it's supported, but unfortunately as far as I'm aware in most browsers that's limited to site-search (in website search after typing a url). It doesn't work at all on iOS. On Firefox it makes it easier to talk a non-technical user through how to change their default search engine, and at least they aren't entering search pattern strings into a settings field as with Chrome.
- nefitty 5y agoI use it on iOS Chrome.
- jedwhite 5y agoAs far as I'm aware and the OpenSearch docs, support is limited to in-site searches on most platforms outside of Firefox (not changing default search option for example using Chrome on iOS). Would be really interested in the steps you followed if you're happy to share them.
- nefitty 5y agoFor sure. I added this file at the top level, as opensearch.xml. Sorry if formatting is wrecked. <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/" > <ShortName>My Search</ShortName> <Description>Personal Search</Description> <Url type="text/html" method="get" template="https://mysite.com/?q={searchTerms}" /> <Url type="application/rss+xml" indexOffset="0" rel="results" template="/results?query={searchTerms}" /> <Url type="application/json" rel="suggestions" template="/suggest?q={searchTerms}" /> <InputEncoding>UTF-8</InputEncoding> <Image height="32" width="32" type="image/x-icon"> https://yarnpkg.com/favicon.ico </Image> </OpenSearchDescription> In the head tag: <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="My Search" /> I then went to my site on Chrome iOS and it showed up under Settings > Search Engine > Recently visited. I then selected it and now anything I put in my url bar gets sent to my server. It's pretty sick.
- jedwhite 5y agoThat's interesting, I don't get that option on Chrome on iPhone (Search Engine > Recently visited), except for the officially supported five (Google, Bing, Yahoo, DDG, Ecosia). I'm wondering do you see that as an option visiting our site (we have an opensearch description for Andi also) or other search engines like You with one? Very curious.
- nefitty 5y agoYeah it didn't work. I checked https://andisearch.com/opensearch.xml https://andisearch.com/opensearch.xml but it redirected to that route with a trailing slash: https://andisearch.com/opensearch.xml/ https://andisearch.com/opensearch.xml/ That might be part of it.
- jedwhite 5y agoThanks for having a look. The opensearch file is https://andisearch.com/andi.xml https://andisearch.com/andi.xml, and it's correctly referenced from the "<link rel="search"..." opensearch tag. If you have a look in Firefox you'll see it prompts in the nav bar. So I don't think that would be the issue. Do you see anything for other engines like You with the opensearch head item?
- jedwhite 5y agoI'm thinking maybe Chrome on iOS has its own flavor of implementation and possibly it needs the filename to be "opensearch.xml" rather than looking at the <link> tag. I'm renaming the file to see if that makes a difference. If you had an example of another site where it worked, that would be awesome. At least one more platform where OpenSearch works for setting the default site search would be nice.