public. Search the Deki index
| Name | Type | Description |
| constraint | string? | Additional search constraints (ex: language:en-us AND type:wiki) default: none |
| format | {xml | search}? | search output format (xml | search) default: xml |
| limit | uint? | max number of results to return (default: 100) |
| offset | uint? | offset |
| q | string | lucene search string |
| sortby | {score, title, date, size, wordcount}? | Sort field. Prefix value with '-' to sort descending. default: score |
Output (XML):
<search>
<page id="{int}" href="{uri}" score="{float}">
...
</page>
<file id="{int}" href="{uri}" score="{float}">
...
</file>
...
</search> Output (search):
<search>
<result>
<uri>{uri}</uri>
<title>{text}</title>
<wordcount>{int}</wordcount>
<host>{text}</host>
<mime>{mimetype}</mime>
<id.page>{int}</id.page>
<id.file>{int}</id.file>
<path>{text}</path>
<tag>{text}</tag>
<type>{text}</type>
<description>{text}</description>
<author>{text}</author>
<date.edited>{date}</date.edited>
<size>{int}</size>
<score>{float}</score>
</result>
...
</search>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", "search").With("q", "title:\"Subpage 1\"").With("format", "xml").Get(); Sample response indicating that one page was found:
<search>
<result>
<uri>http://deki-hayes/Page_Title/Subpage_1</uri>
<title>Subpage 1</title>
<wordcount>10</wordcount>
<host>localhost</host>
<mime />
<id.page>32</id.page>
<id.file />
<path>Page_Title/Subpage_1</path>
<tag />
<type>wiki</type>
<description />
<author>Admin</author>
<date.edited>20070830001331</date.edited>
<size>73</size>
<score>0.9999999</score>
</result>
</search>