Hi,

I have a e-commerce search engine. In this in each document i want to store custom score of each product. And further the score of each product would depend on in which category the product was searched on.

So as this is part of scoring i will be storing this data as doc values. Now i have two options to store this data:

1. I store multiple keys in each document like category_score_a = 4, category_score_b = 5 and based on the category searched i extract the corresponding field value while scoring.

2. I store all the scores in a single field as a delimited string in the document like a:4,b:5,c:6 under a single field say called category_scores and then always extract this field and parse this string and get the score for the corresponding category.

So out of these 2 which one is more efficient way to do this?
I was just worrying that if my number of categories is too much then there will be too many fields per document. Does that impact performance in any way?