Should I use one index or several in Algolia?

I am creating a product search widget that e-commerce customers integrate on their website. Let's say I have 100 customers with 1000 products each.

Visitors to a specific client website can search only for these client products.

Given that the products use the same attributes (id, name, price, etc.) for customers:

Should I use a separate index for each customer or one index to store the products of all customers and somehow connect each product to the customer?

Thanks in advance.

+4
source share
2 answers

,

  • , (, )
  • API (. doc)

, .

+7

. before_action :find_client, , client_id

,

private 
def find_client
 @client = Client.find(params[:client_id]) 
end 

, . client_id .

. find_client.

+1

Source: https://habr.com/ru/post/1670385/


All Articles