We have a intranet website to search customer details. This website is attempting to implement OpenSearch with the suggestions extension as documented at http://www.opensearch.org/Specifications/OpenSearch/Extensions/Suggestions/1.1#Declaring_a_JSON-formatted_search_suggestion_URL.
In /index.html:
<link rel="search" type="application/opensearchdescription+xml" title="XXX" href="/opensearch.xml" />
In /opensearch.xml:
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>XXX</ShortName>
<Description>XXX</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">
https://XXX/favicon.ico
</Image>
<Url rel="results" type="text/html" method="get" template="https://XXX/search.php?q={searchTerms}"/>
<Url rel="suggestions" type="application/x-suggestions+json" method="get" template="https://XXX/opensearch-suggestions.php?q={searchTerms}"/>
</OpenSearchDescription>
Then opensearch-suggestions.php returns a static response:
["a@b.c",["a@b.c"],["XXX"],["XXX.php?email=a@b.c"]]
We can successfully get Safari to send the search to the desired page. However, while typing the suggestions are from DuckDuckGo and not our search engine.
Test case:
- Use macOS + Safari
- Command-N (new window, focuses URL bar)
- Type our intranet URL (the URL bar shows "Top Hit: (THE URL)")
- Press TAB (the URL bar changes to "Search (THE URL)")
- Type a search term like aaa
Expected result:
XXX is the autocomplete suggestion (see opensearch-suggestions.php above)
Actual result:
The URL bar shows "DuckDuckGo Suggestions" and some suggestions from DDG.
Have we implemented this incorrectly? Is there an incompatibility that will prevent us from implementing this standard?