Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Data model
vtex.search
Version: 2.18.9
Latest version: 2.18.9

vtex.search does not own a server-side data model. It is a Store Framework app rendering blocks and exposing one client utility (BiggyClient) that issues Apollo queries against vtex.store-resources. The "model" is therefore the contract between Autocomplete UI components, the GraphQL responses from store-resources, and the local cookies written by this app.

Block contract (from store/interfaces.json)

Block nameReact componentRequired children
autocomplete-result-list.v2Autocomplete (react/Autocomplete.js)product-summary (vtex.product-summary)
did-you-meanDidYouMean (react/DidYouMean.js)
search-suggestionsSuggestions (react/Suggestions.js)
search-bannerBanner (react/Banner.js)

For prop-level configuration (block content schemas, CSS handles), see the per-block markdown under docs/.

Client surface — BiggyClient (react/utils/biggy-client.ts)

BiggyClient is constructed with an Apollo ApolloClient<any> instance and exposes three query methods plus history helpers.

topSearches()


_10
topSearches(): Promise<ApolloQueryResult<{ topSearches: ISearchesOutput }>>

Issues vtex.store-resources/QueryTopSearches. Returns the platform's currently popular search terms. No variables.

suggestionSearches(term)


_10
suggestionSearches(term: string): Promise<ApolloQueryResult<{ autocompleteSearchSuggestions: ISearchesOutput }>>

Issues vtex.store-resources/QueryAutocompleteSearchSuggestions with { fullText: term }. Returns text-side autocomplete suggestions.

suggestionProducts(term, ...)


_12
suggestionProducts(
_12
term: string,
_12
attributeKey?: string,
_12
attributeValue?: string,
_12
productOrigin = false,
_12
simulationBehavior: 'default' | 'skip' | null = 'default',
_12
hideUnavailableItems = false,
_12
orderBy?: string,
_12
count?: number,
_12
shippingOptions?: string[],
_12
advertisementOptions?: AdvertisementOptions
_12
): Promise<ApolloQueryResult<{ productSuggestions: IProductsOutput }>>

Issues vtex.store-resources/QuerySuggestionProducts with the named variables plus:

  • variant ← cookie sp-variant (A/B routing)
  • origin'autocomplete'

Uses fetchPolicy: 'network-only' (autocomplete should never serve stale Apollo cache).

Backwards compatibility: Adding new optional params is safe. Removing or reordering existing ones is breaking for host apps importing BiggyClient.

History helpers


_10
searchHistory(): string[]
_10
prependSearchHistory(term: string, limit = 5): void

Read/write the biggy-search-history cookie. Format: comma-joined list capped at 5 entries. Empty terms are ignored. Existing terms are deduped (moved to the front).

Response shapes


_20
interface ISearchesOutput {
_20
searches: {
_20
term: string
_20
count: number
_20
attributes: Array<{
_20
key: string
_20
value: string
_20
labelKey: string
_20
labelValue: string
_20
}>
_20
}[]
_20
}
_20
_20
interface IProductsOutput {
_20
products: ISearchProduct[] // see react/models/search-product
_20
count: number
_20
misspelled: boolean
_20
operator: string
_20
searchId: string
_20
}

The shape of ISearchProduct is owned by the IS backend and surfaced through vtex.store-resources. Treat it as external.

Cookies and local storage

KeyTypeOwnerPurpose
biggy-search-historycookiethis repoLocal search history for the autocomplete dropdown. Format: comma-joined list, max 5 entries.
sp-variantcookieexternal (IS A/B routing)Read-only here. Forwarded to IS as the variant GraphQL variable.

This app does not read or write localStorage['vtex.search.pickupInPoint'] (owned by vtex.delivery-promise-components).

See also
Vtex.search
VTEX IO Apps
VTEX App Store
VTEX IO Apps
Was this helpful?