XQuery/Open Search

MotivationEdit

You want to allow users to search your site using a tool such as the search boxes in the upper right corner of many web browsers. You want to publish your search interface using standardized documents.

Note that this has not been made to work yet. It is currently in development.

Example of OpenSearch XML Configuration FileEdit

<?xml version="1.0" encoding="UTF-8"?>
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
   <ShortName>Search Shakespeare Plays</ShortName>
   <Description>Use local exist to search for keywords in demo Shakespeare plays that are included in the eXist demos.</Description>
   <Tags>example web</Tags>
   <Contact>yourname@yoursite.com</Contact>
   <Url type="application/application+xml" 
        template="http://localhost:8080/exist/rest/db/search/search.xq?q={searchTerms}"/>
 </OpenSearchDescription>

This file will tell the search tool to take the search terms out of the search text field and perform an HTTP get on the local XQuery on your default eXist running on your local system. If you change your hostname, port or path you just need to update the URL in the XML configuration file.

Last modified on 4 December 2010, at 16:25