GET:site/opensearch

Overview

public. Search the Deki index

Uri Parameters

None

Query Parameters
NameTypeDescription
constraintstring?Additional search constraint (ex: language:en-us AND type:wiki) default: none
format{rss | atom}?search output format (rss | atom) default: atom
limituint?max number of results to return (default: 100)
offsetuint?offset
qstringlucene search string
sortby{score, title, date, size, wordcount}?Sort field. Prefix value with '-' to sort descending. default: score
Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body
Ok200The request completed successfully

Message Format

Output (RSS):

<rss version="2.0">
  <channel>
    <title>{text}</title> 
    <description>{text}</description> 
    <opensearch:totalResults>{int}</opensearch:totalResults> 
    <opensearch:itemsPerPage>{int}</opensearch:itemsPerPage> 
    <opensearch:Query role="request" searchTerms="{text}" startPage="{int}"  /> 
    <atom:link rel="{alternate|search|first|next|last|self}" type="{contenttype}" href="{uri}" /> 
    ...
    <item>
      <title>{text}</title> 
      <link>{uri}</link> 
      <description>{text}</description> 
      <relevance:score>{int}</relevance:score> 
      <dekilucene:size>{int}</dekilucene:size> 
      <dekilucene:wordcount>{int}</dekilucene:wordcount> 
      <dekilucene:path>{text}</dekilucene:path> 
      <dekilucene:page.parent id="{int}" path="{text}" title="{text}" href="{uri}" /> 
    </item>
    ...
  </channel>
</rss>

  Output (Atom):

<feed>
  <generator version="{text}">{text}</generator> 
  <updated>{date}</updated> 
  <title type="{text}">{text}</title> 
  <author>
    <name>{text}</name> 
  </author>
  <id>{uri}</id> 
  <opensearch:totalResults>{int}</opensearch:totalResults> 
  <opensearch:itemsPerPage>{int}</opensearch:itemsPerPage> 
  <opensearch:Query role="request" searchTerms="{text}" startPage="{int}"/> 
  <link rel="{alternate|search|first|next|last|self}" type="{contenttype}" href="{uri}" /> 
  ...
  <entry>
    <title type="text">{text}</title> 
    <published>{date}</published> 
    <updated>{date}</updated> 
    <link href="{uri}" /> 
    <id>{uri}</id> 
    <content type="text">{text}</content> 
    <relevance:score>{int}</relevance:score> 
    <dekilucene:size>{int}</dekilucene:size> 
    <dekilucene:wordcount>{int}</dekilucene:wordcount> 
    <dekilucene:path>{text}</dekilucene:path> 
    <dekilucene:page.parent id="{int}" path="{text}" title="{text}" href="{uri}" /> 
  </entry>
  ...
</feed>

   

Implementation Notes

Refer here for more information on the Lucene search string format.

Refer here for more information about OpenSearch.

Code Samples

The following code example searches for pages with the title "Subpage_1":

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("site", "opensearch").With("q", "title:\"Subpage_1\"").With("format", "rss").Get();

Sample response indicating that one page was found:

<rss version="2.0">
  <channel>
    <title>Deki Wiki Search</title> 
    <link>http://deki-hayes/@api/deki/site/opensearch?q=title:subpage_1&format=rss&offset=0&limit=100</link> 
    <description>Deki Wiki Search</description> 
    <opensearch:totalResults xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">100000</opensearch:totalResults> 
    <opensearch:itemsPerPage xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">100</opensearch:itemsPerPage> 
    <opensearch:Query role="request" searchTerms="title%3asubpage_1" startPage="1" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" /> 
    <atom:link rel="alternate" type="text/html; charset=utf-8" href="http://deki-hayes/Special:Search?search=title:subpage_1&limit=100&offset=0" xmlns:atom="http://www.w3.org/2005/Atom" /> 
    <atom:link rel="search" type="application/opensearchdescription+xml" href="http://deki-hayes/@api/deki/site/opensearch/description" xmlns:atom="http://www.w3.org/2005/Atom" /> 
    <atom:link rel="first" href="http://deki-hayes/@api/deki/site/opensearch?q=title:subpage_1&format=rss&offset=0&limit=100" type="application/atom+xml; charset=utf-8" xmlns:atom="http://www.w3.org/2005/Atom" /> 
    <atom:link rel="next" href="http://deki-hayes/@api/deki/site/opensearch?q=title:subpage_1&format=rss&offset=100&limit=100" type="application/atom+xml; charset=utf-8" xmlns:atom="http://www.w3.org/2005/Atom" /> 
    <atom:link rel="last" href="http://deki-hayes/@api/deki/site/opensearch?q=title:subpage_1&format=rss&offset=99900&limit=100" type="application/atom+xml; charset=utf-8" xmlns:atom="http://www.w3.org/2005/Atom" /> 
    <item>
      <title>Subpage 1</title> 
      <link>http://deki-hayes/Subpage_1</link> 
      <description>This page has no content. Enrich Deki Wiki by contributing.</description> 
      <relevance:score xmlns:relevance="http://a9.com/-/opensearch/extensions/relevance/1.0/">1</relevance:score> 
      <dekilucene:size xmlns:dekilucene="http://services.mindtouch.com/deki/draft/2007/06/luceneindex">67</dekilucene:size> 
      <dekilucene:wordcount xmlns:dekilucene="http://services.mindtouch.com/deki/draft/2007/06/luceneindex">10</dekilucene:wordcount> 
      <dekilucene:path xmlns:dekilucene="http://services.mindtouch.com/deki/draft/2007/06/luceneindex">Subpage_1</dekilucene:path> 
    </item>
  </channel>
</rss>
Tag page
You must login to post a comment.