OpenSearch / support json for auto-completion
| Project: | API |
| Version: | 6.x-1.x-dev |
| Component: | Search |
| Category: | feature request |
| Priority: | normal |
| Assigned: | smk-ka |
| Status: | closed |
OpenSearch provides a standardized XML format for describing a search engine in such a way that it can be used from another application without having to visit the search page - for example, the search box in Firefox.
For people who use it very often (as usual for an API, while developing), it would be very convenient to be able to search without first heaving to visit the page, simply by using this search box.
The module itself is just a simple XML file that can be written down in 5 minutes (I made one for my own use), but it would be very nice to have auto-completion as well - especially since the search page itself offers it already. That's more tricky, since it requires that suggestions be returned in a different format (though also JSON) than they are now, namely as a nested array.
--
I realize that actual support of this technology is somewhat more complex, but it would be an improvement for the user interface of the API and could be considered at some point in the future.

#1
This would indeed be a nice feature. So nice that I decided to simply add it.
You can test drive the result using my development server if you follow these steps:
EDIT: removed since URL is not valid anymore.
#2
Is there any particular advantage to having Mycroft host the search plugin rather than building that right into API module? Building into the module would support all versions/branches automatically and might improve autodiscovery.
#3
+1 to api.drupal.org providing it's own OpenSearch plugins instead of hosting at MyCroft or someone's homepage.
#4
+1, that would indeed be nice. The last time I've been looking for Drupal plugins on mycroft there were two or three of them, and it was definitely confusing to choose the right one.
#5
Rerolled patch, added autodiscovery and magic OpenSearch plugin generation per branch.
I have not tested it with other browsers that support the OpenSearch specification, but the code Mozilla promotes seems to also be compatible with IE7+. It includes all features supported by Firefox: search suggestions, the SearchForm element, and automatic updates (the latter is a Fx 3.5 feature).
#6
Looking good, but needs a few minor changes:
* If the site's favicon is configured in the theme settings, that should be used.
* Search callbacks should ideally handle search strings with slashes in them.
* _api_fuzzy_search() needs a doc comment.
* I think the $limit argument should have a default value.
#7
#8
Rerolled patch with drumm's suggestions.
#9
Committed.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.