Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
nameFacet
Code Block
languagetypescript
type FacetType = 'checkbox' | 'color' | 'link' | 'range-slider' | 'recent-searches' | 'related-searches' | 'search' | 'size' | 'tabs'

Code Block
languagetypescript
interface FacetValueColor {
    name: string;
    hex?: string;
    imageUrl?: string;
}

Code Block
languagetypescript
interface FacetValue {
    title: string;
    imageUrl?: string;
    value?: string;
    color?: FacetValueColor;
    count?: number;
    level?: number;
    selected?: boolean;
    excluded?: boolean;
    children?: Array<FacetValue>;
}

Code Block
languagetypescript
interface Facet {
    id: number;
    type: FacetType;
    title: string;
    values?: Array<FacetValue>;
    field?: string;
    collapsible: boolean;
    collapsed?: boolean;
    rangeMin?: number;
    rangeMax?: number;
    rangeStart?: number;
    rangeEnd?: number;
    searchable?: boolean;
    searchWithin?: string;
    tooltip?: string;
    truncateThreshold?: number;
    visible: boolean;
}

Pagination

Excerpt
namePagination
Code Block
languagetypescript
interface PaginationOption {
    title: string;
    pageSize: number;
    selected: boolean;
    default: boolean;
}

Code Block
languagetypescript
interface Pagination {
    page: number;
    pageSize: number;
    totalPages: number;
    totalResults: number;
    maxPageLinks?: number;
    displayFirstLink: boolean;
    displayLastLink: boolean;
    options: Array<PaginationOption>;
}

Redirects

Excerpt
nameRedirect
Code Block
languagetypescript
interface Redirect {
    url: string;
    target?: string;
}

...

Excerpt
nameSelectedFacet
Code Block
languagetypescript
export interface SelectedFacetValue {
    title: string;
    value: string;
    excluded: boolean;
}

Code Block
languagetypescript
export interface SelectedFacet {
    field: string;
    title: string;
    values: Array<SelectedFacetValue>;
}

Search Results Items

Excerpt
nameSearchResultsItem
Code Block
languagetypescript
type SearchResultsItemType = 'content' | 'product';

Code Block
languagetypescript
interface SearchResultsItem {
    id: string;
    pinned: boolean;
    visible: boolean;
    score: number;
    type: SearchResultsItemType;
    imageUrl?: string;
    title: string;
    url: string;
    price?: number;
    salePrice?: number;
    attributes?: {
        [key: string]: Array<string>;
    };
}

Sorting

Excerpt
nameSorting
Code Block
languagetypescript
interface SortingOption {
    title: string;
    value: string;
    default: boolean;
    selected: boolean;
}

Code Block
languagetypescript
interface Sorting {
    value?: string;
    options: Array<SortingOption>;
}

Search Response

Excerpt
nameSearchResponse
Code Block
languagetypescript
interface SearchResponse {
    contentZones?: ContentZones;
    facets?: Array<Facet>;
    modifiedQuery?: string;
    pagination?: Pagination;
    query?: string;
    querySuggestions?: Array<string>;
    redirect?: Redirect;
    results?: Array<SearchResultsItem>;
    selectedFacets?: Array<SelectedFacet>;
    sorting?: Sorting;
    success: boolean;
    trackingId: string;
}

...

Excerpt
nameSearchRequest
Code Block
languagetypescript
type SelectedFacets = {
    [key: string]: Array<string> | undefined;
};

Code Block
languagetypescript
interface SearchRequest {
    disableSpellcheck?: boolean;
    facets?: SelectedFacets;
    newRequest: boolean;
    pageSize?: number;
    page?: number;
    query?: string;
    searchWithin?: string;
    sort?: string;
}