GET:site/query

Response

Intelligent Search Results

This API endpoint response, along with the API endpoint request parameters, contains the necessary information to provide a filtered and faceted search experience with search analytics tracking.

<search ranking="adaptive" queryid="{queryid}" sessionid="{sessionid}" querycount="{querycount}" count.recommendations="{count.recommendations}" count="{count}">

    <!-- multiple search recommendations can be returned depending on site search recommendation configuration -->
    <recommendations id="{recommendations/@id}"/>
    ...
    
    <!-- search results represent pages, recommended pages, or files -->
    <result>
        <id>{id}</id>
        <uri>{uri}</uri>
        <uri.track>{uri.track}</uri.track>
        <rank>{rank}</rank>
        <title>{title}</title>
        
        <!-- if {type} = page: page is the location of content that best matches search terms based on the search algorithim -->
        <!-- if {type} = recommended: page is the configured location that matches exact search terms -->
        <!-- if {type} = file: page is the location of the file attachment that contains content that best matches search terms based on the search algorithim -->
        <page>
            <rating score="{page/rating/@score}" count="{page/rating/@count}"/>
            <title>{page/title}</title>
            <path>{page/path}</path>
            <uri.ui>{page/uri.ui}</path>
        </page>
        <author>{author}</author>
        
        <!-- if {type} = page / recommended: {preview} is the provided page summary or extracted page summary from page content -->
        <!-- if {type} = file: {preview} is extracted from file attachment content -->
        <preview>{preview}</preview>
        <content>{preview}</content>
        <date.modified>{date.modified}</date.modified>   
        <type>{type}</type>
        <mime>{mime}</mime>
        <tag>{tag}</tag>
        
        <!-- if {metrics} = true -->
        <metric.views>{metric.views}</metric.views>
        <metric.charcount>{metric.charcount}</metric.charcount>
    </result>
    ...
        
    <!-- if {includeaggs} = true -->
    <!-- aggregates are used to build filters and facets on the Intelligent Search UI (ex: https://example.com/Special:Search) -->
    <aggs>
        <pages>
            <pages count="{aggs/pages/@count}" id="{aggs/pages/@id}">
                <value>{aggs/pages/value}</value>
                <title>{aggs/pages/title}</title>
            </pages>
            ...
        </pages>
        <articles>
            <articles count="{aggs/articles/@count}">
                <value>{aggs/articles/value}</value>
            </articles>
            ...
        </articles>            
        <custom_classifications>
            <custom_classifications count="{aggs/custom_classifications/@id}">
                <value>{aggs/custom_classifications/classification}</value>
                <custom_classifications>
                    <custom_classifications count="{aggs/custom_classifications/@count}">
                    <value>{aggs/custom_classifications/value}</value>
                </custom_classifications>
            </custom_classifications>
            ...
        </custom_classifications>
    </aggs>
</search>
Name Type Description
{queryid} string Unique search query id for tracking or refining search results for a query (included in search analytics tracking URL)
{sessionid} string Unique search session id (included in search analytics tracking URL)
{querycount} int Total count of resources matched by search query (ignoring limit and offset)
{count.recommendations} int Total count of recommended search results
{count} int Count of resources matched by search query with requested limit and offset
{recommendations/@id} int A page id of a recommended search result
{id} int The id of the resource content that matched the search query
{uri} uri The resource location URL that matched the search query
{uri.track} uri The search analytics tracking beacon URL to request when the search result is selected or clicked
{rank} float Relative search ranking to order search results from most relevant to least
{title} string The search result display title (contextual to resource: page display title or filename)
{page/rating/@score} int The current rating score of the search result page
{page/rating/@count} int The number of times the search result page has been rated
{page/title} string The search result page display title
{page/path} string The search result page hierarchy location
{page/uri.ui} string The search result page location URL
{author} string Username of the author who last modified the resource that matched the search query
{preview} string Search result preview content
{date.modified} datetime ISO 8601 representation of the resource's last modification timestamp
{type} {page, recommended, file} The search result type
{mime} string The resource media type
{tag} string Whitespace separated listed of search result page tags, classifications, and page type
{metric.views} int The total count of resource views
{metric.charcount} int The total count of characters in resource content
{aggs/pages/@count} int The number of search results under the location filter option
{aggs/pages/@id} int The page id of the location filter option
{aggs/pages/value} string The name of the location filter option
{aggs/pages/title} string The display title of the location filter option
{aggs/articles/@count} int The number of search results under the page type filter option
{aggs/articles/value} string The name of the page type filter option
{aggs/custom_classifications/classification} string The custom classification filter option classification name
{aggs/custom_classifications/@count} int The number of search results under the custom classification filter option
{aggs/custom_classifications/value} string The custom classification filter option classification value