Options
All
  • Public
  • Public/Protected
  • All
Menu

@sajari/sdk-js

Index

Type Aliases

ActivePromotion: { active_exclusions: PromotionExclusion[]; active_pins: PromotionPin[]; promotion_id: string }

A Promotion adjusts search results via a set of rules configured by the client. All promotions which are triggered by the current search are returned.

Type declaration

Aggregates: Record<string, Record<string, CountAggregate | MetricAggregate>>
Banner: { description?: string; height: number; id: string; image_url: string; position: number; target_url: string; text_color?: string; text_position?: "TEXT_POSITION_UNSPECIFIED" | "TEXT_POSITION_CENTER" | "TEXT_POSITION_TOP_LEFT" | "TEXT_POSITION_TOP_RIGHT" | "TEXT_POSITION_BOTTOM_LEFT" | "TEXT_POSITION_BOTTOM_RIGHT"; title?: string; width: number }

Type declaration

  • Optional description?: string

    The description of the banner, displayed in sub-head font.

    memberof

    Banner

  • height: number

    The ID of the banner, used to identify clicked banners.

    memberof

    Banner

  • id: string

    The ID of the banner, used to identify clicked banners.

    memberof

    Banner

  • image_url: string

    The URL of the image used for the banner.

    memberof

    Banner

  • position: number

    The 1-based index indicating where the banner appears in search results.

    memberof

    Banner

  • target_url: string

    The color of the text as a hex code with a # prefix, e.g. #FFCC00 or #FC0.

    memberof

    Banner

  • Optional text_color?: string

    The color of the text as a hex code with a # prefix, e.g. #FFCC00 or #FC0.

    memberof

    Banner

  • Optional text_position?: "TEXT_POSITION_UNSPECIFIED" | "TEXT_POSITION_CENTER" | "TEXT_POSITION_TOP_LEFT" | "TEXT_POSITION_TOP_RIGHT" | "TEXT_POSITION_BOTTOM_LEFT" | "TEXT_POSITION_BOTTOM_RIGHT"

    text_position describes the position of text in a box.

    • TEXT_POSITION_UNSPECIFIED: No position specified.
    • TEXT_POSITION_CENTER: The text is positioned in the horizontal and vertical center.
    • TEXT_POSITION_TOP_LEFT: The text is positioned in the top left corner.
    • TEXT_POSITION_TOP_RIGHT: The text is positioned in the top right corner.
    • TEXT_POSITION_BOTTOM_LEFT: The text is positioned in the bottom left corner.
    • TEXT_POSITION_BOTTOM_RIGHT: The text is positioned in the bottom right corner.
    memberof

    Banner

  • Optional title?: string

    The title of the banner, displayed in header font.

    memberof

    Banner

  • width: number

    The width the banner occupies in grid cells.

    memberof

    Banner

KeySecretCredentials: { key: string; secret: string }

Type declaration

  • key: string
  • secret: string
MetricAggregate: number
PipelineIdentifier: Partial<{ name: string; version: string }>

PipelineIdentifier is a name, version tuple that identifies a Query pipeline.

PromotionExclusion: { key: { field: string; value: string } }

PromotionExclusion defines a promotion exclusion.

Type declaration

  • key: { field: string; value: string }
    • field: string
    • value: string
PromotionPin: { key: { field: string; value: string }; mode?: "PIN" | "PROMOTE"; position: number }

PromotionPin defines a promotion pin.

Type declaration

  • key: { field: string; value: string }
    • field: string
    • value: string
  • Optional mode?: "PIN" | "PROMOTE"
  • position: number
Redirect: { id: string; target: string }

A Redirect defines a search string which clients should handle by sending users to a specific location instead of a standard search results screen. In a default setup, these are only returned by an autocomplete pipeline. Web search clients handle redirects by sending the web browser to the target URL. Other clients (mobile) may handle redirect forwarding differently. See [[QueryResponse.redirects]] for redirect collection details.

Type declaration

  • id: string
  • target: string
ValueFunc: (() => string)

Type declaration

    • (): string
    • Returns string

ValueType: string | number | boolean | string[] | number[] | boolean[] | ValueFunc

Variables

EVENT_OPTIONS_UPDATED: "options-updated" = "options-updated"
EVENT_SEARCH_SENT: "search-sent" = "search-sent"
EVENT_SELECTION_UPDATED: "selection-updated" = "selection-updated"
EVENT_VALUES_UPDATED: "values-changed" = "values-changed"

Functions

  • formatAggregates(aggregatesProto?: undefined | Record<string, Aggregate>): Aggregates
  • Parameters

    • aggregatesProto: undefined | Record<string, Aggregate> = {}

    Returns Aggregates

  • getItem(key: string): null | string
  • Parameters

    • key: string

    Returns null | string

  • setItem(key: string, value: string): void
  • Parameters

    • key: string
    • value: string

    Returns void

Generated using TypeDoc