XQuery/Open Search

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Motivation[edit | edit source]

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 File[edit | edit source]

<?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>
   <Url type="application/application+xml" 

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.