Skip to content

Commit

Permalink
fix: Update algolia.md (#4734)
Browse files Browse the repository at this point in the history
## Fix bug where products are not added to Algolia index

Previously, the id property was used as the unique identifier for products in the Algolia index. However, Algolia requires the use of the objectID property as the unique identifier. 

This commit updates the transformer function for the products index to use the objectID property instead of the id property, ensuring that products are properly added to the Algolia index.
  • Loading branch information
pedrotigre authored Aug 11, 2023
1 parent 1d26375 commit 6dd3056
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/content/plugins/search/algolia.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const plugins = [
],
},
transformer: (product) => ({
id: product.id,
objectID: product.id,
// other attributes...
}),
},
Expand Down

1 comment on commit 6dd3056

@vercel
Copy link

@vercel vercel bot commented on 6dd3056 Aug 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.