跳轉到內容

XQuery/Open Search

來自華夏公益教科書

您想允許使用者使用諸如許多網路瀏覽器右上角的搜尋框之類的工具搜尋您的網站。您想使用標準化文件釋出您的搜尋介面。

請注意,這尚未實現。目前正在開發中。

OpenSearch XML 配置檔案示例

[編輯 | 編輯原始碼]
<?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="https://:8080/exist/rest/db/search/search.xq?q={searchTerms}"/>
 </OpenSearchDescription>

此檔案將告訴搜尋工具從搜尋文字欄位中取出搜尋詞,並對您本地系統上執行的預設 eXist 上的本地 XQuery 執行 HTTP get 操作。如果您更改主機名、埠或路徑,您只需要更新 XML 配置檔案中的 URL。

華夏公益教科書