Some features aren't implemented for v1 #559
Replies: 4 comments 12 replies
-
|
Beta Was this translation helpful? Give feedback.
-
(2) You need to pass |
Beta Was this translation helpful? Give feedback.
-
Something that would be amazing is reusing the "Fill query" functionality as an attribute (or property, flag) for plugins implementations, such as brands, categories, products, so on. I mean, the method Scenario 2 - we can implement this with a custom |
Beta Was this translation helpful? Give feedback.
-
@francoischalifour For this version we have implemented:
Not enough doc for A code sandbox for reproduction: Property 'popularity' does not exist on type 'Hit<WithAutocompleteAnalytics<Hit<ProductRecord>>>[]'.ts(2339 Based on the suggestions w/ hits sandbox: My issue is to transform the transformResponse({ hits }) {
return hits.map((hit) => ({
...hit,
comments: hit.popularity % 100,
sale: hit.free_shipping,
// eslint-disable-next-line @typescript-eslint/camelcase
sale_price: hit.free_shipping
? (hit.price - hit.price / 10).toFixed(2)
: hit.price
}));
} Previously implemented by export function createProductsPlugin({
searchClient
}: CreateProductsPluginProps): AutocompletePlugin<ProductHit, undefined> {
return {
getSources({ query, state, setContext }) {
return [
{
sourceId: "productsPlugin",
getItems() {
return getAlgoliaResults<ProductHit>({
searchClient,
queries: [
{
indexName: "instant_search",
query,
params: {
clickAnalytics: true,
hitsPerPage: 8,
attributesToSnippet: ["name:10", "description:35"],
snippetEllipsisText: "…"
}
}
],
})
.then(([result]) => {
setContext({ nbProducts: result.nbHits });
return result.hits.map((hit) => ({
...hit,
comments: hit.popularity % 100,
sale: hit.free_shipping,
// eslint-disable-next-line @typescript-eslint/camelcase
sale_price: hit.free_shipping
? (hit.price - hit.price / 10).toFixed(2)
: hit.price
}));
});
},
getItemInputValue({ item }) {
return item.name;
}, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have to ask about it because I've seen that some features aren't implemented or aren't in the docs yet.
Scenario 1 - Brands plugin
I'm creating a brands plugin that calls
getAlgoliaFacetHits
and plugin it in the main autocomplete, but when I click in the search input, it throws an error:There's no doc for this, only this section that's not for this javascript library:
How to Declare Attributes for Faceting:
https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/how-to/declaring-attributes-for-faceting/
Scenario 2 - Products plugin
When the user clicks on the "Add to cart" button, the page will call for
AlgoliaAnalytics.convertedObjectIDsAfterSearch
that throws an error:Scenario 3 - Algolia's logo:
There's no doc for adding the Algolia logo in the hits' results. I put a "Footer" message where should be the suggestions' footer place.
🔗 Link for reproduction:
https://codesandbox.io/s/algolia-autocomplete-starter-forked-sgwsq
ℹ️ Sources related to this question:
When I search for it on the internet, I found only docs related to other JavaScript libraries:
https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/how-to/declaring-attributes-for-faceting/
Beta Was this translation helpful? Give feedback.
All reactions