Overview

public. Search the Deki index

Uri Parameters

None

Query Parameters
NameTypeDescription
constraintstring?Additional search constraints (ex: language:en-us AND type:wiki) default: none
format{xml | search}?search output format (xml | search) default: xml
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 (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>

Implementation Notes

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

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", "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>
Tag page
You must login to post a comment.
Powered by MindTouch Deki Enterprise Edition v.8.08 RC2