Skip to main content

SearchResults

Overview​

SearchResults is a conditional type that represents the possible search result types available in the High Velocity front-end app. The type used depends on the lineItemType specified in the SearchModes.

type SearchResults<T extends SearchModes['lineItemType'] = 'expanded'> =
T extends 'expanded' ? ProductSearchResults : ProductReferenceSearchResults;

ProductSearchResults​

Represents the search results containing detailed product information. Inherits from BaseSearchResults.

Attributes​

type​

type: literal = 'product'


Indicates that the search results are of type 'product'.

results​

type: Product[]

The list of products in the search results.

ProductReferenceSearchResults​

Represents the search results containing product references. Inherits from BaseSearchResults.

Attributes​

type​

type: literal = 'reference'


Indicates that the search results are of type 'reference'.

results​

type: ProductReference[]

The list of product references in the search results.

BaseSearchResults​

This contains attributes shared by all types of search results.

Attributes​

input​

type: ProductSearchInput

The input parameters used for the product search.

refinements​

type: Refinement[]

The list of refinements applied to the search results.

sortOptions (optional)​

type: string[]


The list of sort options available for the search results.

totalCount​

type: number


The total number of items found.

pagination​

type: object


The pagination information for the search results.

pagination.currentPage​

type: number | string


The current page number.

pagination.totalPages (optional)​

type: number


The total number of pages.

pagination.nextPage​

type: number | string


The next page number.

pagination.hasNextPage​

type: boolean


Indicates whether there is a next page.