# ElasticSearch products + product varianst + custom prices for clients

**URL:** <https://discuss.elastic.co/t/elasticsearch-products-product-varianst-custom-prices-for-clients/19295>\
**Category:** Elasticsearch\
**Created:** [August 14, 2014, 8:08pm UTC](https://discuss.elastic.co/t/elasticsearch-products-product-varianst-custom-prices-for-clients/19295 "2014-08-14T20:08:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kisi](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@kisi](https://discuss.elastic.co/u/kisi)\
**Post date:** [August 14, 2014, 8:08pm UTC](https://discuss.elastic.co/t/elasticsearch-products-product-varianst-custom-prices-for-clients/19295/1 "2014-08-14T20:08:55Z")

</div>

Hi!

I'm trying to store and search for products and product variants in  
Elasticsearch. I have a set of products (about 4000) and product variants  
(all together about 20000) which are related to the products. A product  
could be a hole-puncher and it variants are a hole-puncher in green, a  
hole-puncher in red… (+different attributes).

In addition I have customers (about 40000). Some of them (about 10000) have  
a special range of products (a specific sub-set out of the “product  
/product variant pool”). E.g. Client 1 has the hole-puncher in red and  
green. Client 2 has the hole-puncher in red and yellow. Client 3 has the  
hole-puncher in red. Client 4 doesn’t have the hole-puncher …

In Addition each Client of these 10000 Clients have special Prices for the  
product variants and the product variants can have a different  
assortment-type (a primary or a secondary product). I have to search for  
the products and display the product information + the amount of product  
variants. A search result should look like this: Super Hole Puncher The  
Description form the product X-Product variants Lowest Price XX

In Addition I have to provide a facettennavigation with product-categories…  
and filters. I have to filter for different attributes, the price of a  
product variant, the assortment-type.

How would you store the Data? Would you create one index for the products  
or would you create one index for each customer with a special product set  
(which would result in 10000 Indices).

How would you store the data which is individual for the clients  
(product-type + Price). Currently I store the Client information as  
nesteted Object, but I don’t know if this is the way I should go. Maybe  
seperate columns/fields for each customer? This would cause a document  
which have about 10000 fields. What amount of fields can elasticsearch  
handle without performance issues?

Sample JSON:

{  
"Hole-puncher 5008": {  
"MasterArticleNumber": "",  
"Title": "Hole-puncher 5008",  
"Attributes": {  
"Width": "100 mm"  
}},"123456": {  
"MasterArticleNumber": "Hole-puncher 5008",  
"Title": "Hole-puncher 5008 in blue",  
"Description": "the description",  
"Attributes": {  
"Width": "100 mm",  
"Color": "blue"  
},  
"Clients": [  
{  
"Type": "K",  
"Price": 78,  
"Client": 1  
},  
{  
"Type": "R",  
"Price": 80,  
"Client": 2  
}  
]}, "78977": {  
"MasterArticleNumber": "Hole-puncher 5008",  
"Title": "Hole-puncher 5008 in black ",  
"Description": "the description",  
"Attributes": {  
"Width": "100 mm",  
"Color": "black"  
},  
"Clients": [  
{  
"Type": "K",  
"Price": 78,  
"Client": 1  
},  
{  
"Type": "R",  
"Price": 80,  
"Client": 2  
}  
]}}

Currently I'm storing the main product as the parent of the  
product-variants because i have to display the parent-product in the search  
result. Is it possible to sort the parent product on the lowest matching  
price of its childs?

I would be really thankfully for any help /hint 🙂

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/533da221-8e58-4bbc-833e-c379c116705c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/533da221-8e58-4bbc-833e-c379c116705c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:08am UTC](https://discuss.elastic.co/t/elasticsearch-products-product-varianst-custom-prices-for-clients/19295/2 "2017-07-06T01:08:25Z")

</div>


