Adding more data to items in an index

We have Product data in 1 system, then we have users create ratings and reviews on those products that get stored in a different system. We want to have attributes like Total Number of Ratings, and Average Rating, be included in the search index so we can apply the regular InstantSearch.js functionality to it.

What would be the best way to get the data into the index?

Currently I’m thinking we would periodically run a job that wound 1) get products from the index, 2) for each product query the ratings and reviews API endpoint for the attributes and do a partial update into the index.

Thoughts?

Hi,

Yes this sounds good to me, I would have done the same :slight_smile:
But maybe instead of getting the products from the index (you would need to use the browse method from our API client) you could directly iterate through your own database and products table. It would require less network calls and the job itself would be faster. Is that possible on your side?

Definitely possible. Thanks for the confirmation on direction. We will plan it out.