Search Response

In Sitecore Search, all search responses are SearchResponse objects. This topic describes some response objects. After you have installed the JS Data package in your project, these methods and their documentation will be available in your IDE.

SearchResponse type

Name

Type

Description

ts

number

Time at which the Sitecore server served the response, in milliseconds.

dt

number

Response processing time in milliseconds.

widgets

Array<SearchResponseWidget>

Depends on request.

SearchResponseWidget type

Name

Type

Description

rfk_id

string

rfk_id of the widget in the response.

type

WidgetDataType

Enumerator.

WidgetDataType.RECOMMENDATION, WidgetDataType.PREVIEW_SEARCH, WidgetDataType.SEARCH_RESULTSWidgetDataType.CONTENT_BLOCK, WidgetDataType.QUESTIONS, WidgetDataType.HTML_BLOCK,    WidgetDataType.BANNER, and WidgetDataType.SEO

answer

SearchResponseAnswer

content

Array<T>

Entity items are available in an array with the entity name.

T extends the entity model.

List of Content entity items. You only see this if you pass a content object in the request.

entity

Entity

The entity type of this widget response.

facet

Array<SearchResponseFacet>

List of facets. You see this only if you pass a facet object in the request.

limit

number

Maximum number of items you requested.

offset

number

Offset applied to the request. You see this only if you pass an offset object in the request.

related_questions

Array<SearchResponseAnswer>

List of related_questions object.

rfk_debug

Record<string, any>

Debug information for this request.

rule

SearchResponseRule

Contains the rules applied in the response.

sort

SearchResponseSort

Contains the sorting information you requested. You see this only if you pass a sort object in the request.

suggestion

Record< string, Array<SearchResponseSuggestion> >

List of suggestions for the key phrase. You see this only if you pass a suggestions object in the request.

total_item

number

Total number of content items that match the request.

appearance

SearchResponseAppearance

Depends on WidgetDataType.

Using a SearchResponseWidget object

All search responses from Sitecore Search include an array of SearchResponseWidget objects. The structure of each of these objects is dynamic, because it's based on the query and available results.

Tip

For more information, see the node_modules\@sitecore_search folder.

Do you have some feedback for us?

If you have suggestions for improving this article,