import type { Suggestion } from './Suggestion'; import type { PageMetaTag } from './PageMetaTag'; import type { ProductSearchRefinement } from './ProductSearchRefinement'; import type { ProductSearchHit } from './ProductSearchHit'; import type { ProductSearchSortingOption } from './ProductSearchSortingOption'; import type { ProcessedQuery } from './ProcessedQuery'; import type { SearchMode } from './SearchMode'; /** * @type ProductSearchResult: Document representing a product search result. * * @property hits: A sorted array of search hits (`ProductSearchHit` objects). The array can be empty. * * @property pageMetaTags: Page Meta tags associated with the search result. * * @property query: The query string that was searched for. * - **Max Length:** 50 * * @property searchMode: The search matching approach the client requested for this search, echoed back from the `searchMode` query parameter. Omitted when the request did not supply one. This is the requested hint, not necessarily the mode that served the result — see `effectiveSearchMode`. * * @property effectiveSearchMode: The search matching approach the platform actually used to serve this result. May differ from the requested `searchMode` when the platform demoted the mode (for example when the semantic index is unavailable). * * @property processedQuery: The result of query processing. * * @property refinements: The sorted array of search refinements. This array can be empty. * * @property searchPhraseSuggestions: The suggestion given by the system for the submitted search phrase. * - **Min Length:** 1 * * @property selectedRefinements: A map of selected refinement attribute ID or value pairs. The sorting order is the same as in request URL. * * @property selectedSortingOption: The ID of the applied sorting option. * - **Max Length:** 4000 * * @property sortingOptions: The sorted array of search sorting options. This array can be empty. * * @property offset: The zero-based index of the first hit/data to include in the result. * * @property limit: Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema. * * @property total: The total number of hits that match the search\'s criteria. This can be greater than the number of results returned as search results are pagenated. * */ export type ProductSearchResult = { hits: Array; pageMetaTags?: Array; query: string; searchMode?: SearchMode; effectiveSearchMode?: SearchMode; processedQuery?: ProcessedQuery; refinements: Array; searchPhraseSuggestions: Suggestion; selectedRefinements?: { [key: string]: string; }; selectedSortingOption?: string; sortingOptions: Array; offset: number; limit: number; total: number; } & { [key: string]: any; };