Hi team, I have an ecommerce use case where we hav...
# community-help
m
Hi team, I have an ecommerce use case where we have suppliers selling products. We have many different types of suppliers, some can have 90k different products to sell and others can have only 10 products. They usually have products in several categories. The problem of equitable distribution arises when searching products with "multi supplier queries", that is to say where multiple suppliers are supposed to be found in the results (e.g product_price < 50$), which is very often the case on big ecommerce platforms. One important rule for us is that a supplier cannot be "promoted" (kind of) just because he has 150 times more products then the others. Until migrating to Typesense, here is what we did : 1. We calculate several scores for a product based on metrics like : its rating, its competitiveness, its order growth, is the supplier reactive, and so on, to have a global score. 2. This global score is used to sort products, to propose best scored products to clients according to their search queries. 3. For each search query, we find products that can match from every supplier concerned by the query. Then we distribute each product on a 20 products page where each supplier matched can have maximum 3 products displayed per page. All results are sorted by their product_score. I am currently trying to reproduce this behavior in Typesense with the grouping parameters and the pagination parameters. I use a small dataset of 9946 products for tests. My problem is that for a global query, I only find 40 documents out of 9946. With pages of 20 products, the third page is empty (big problem). I should have approximately 500 pages available, with maximum 3 products, for each supplier, per page of 20 products. 1. Am I doing something wrong or is there a parameter that I misunderstood ? 2. If the supplier distribution is not equitable, e.g supplier A have 9900 products in the results, and supplier B has 46, does the grouping parameters allow to have 10 products for supplier A and B on the first 4 pages, then the 5th page has 14 products of supplier A and 6 products of supplier B, and finally all remaining pages have supplier A products 3. More generally, this business rule is a common rule for a ecommerce platform with multiple suppliers proposing their products. Is there a better way to handle an equitable distribution ? I give the supplier repartition of my test dataset and the query screenshot in the thread