Skip to main content
Version: 0.1.x

Search

obsolete: check how this is referenced now
not implemented

Search service

The search service encapsules two methods of searching on Shopify:

  • The Predictive Search API
  • Native search via JSON search templates.

// TODO

ts
const typeahead = search.createTypeahead({
debounce: 250,
});
const suggestions = await typeahead.suggest({
query,
resources: {
product: {
limit: 10,
includeUnavailable: false,
},
page: {
limit: 5,
fields: [
'author',
]
}
},
});
const results = await search.nativeSearch({
query,
});
ts
const typeahead = search.createTypeahead({
debounce: 250,
});
const suggestions = await typeahead.suggest({
query,
resources: {
product: {
limit: 10,
includeUnavailable: false,
},
page: {
limit: 5,
fields: [
'author',
]
}
},
});
const results = await search.nativeSearch({
query,
});