I have the some fields in my solr document like
default_price : 100.0,
seg_price_1 : 90.0,
seg_price_2 : 88.0,
seg_price_3 : 75.0
out of these prices i have to consider the minimum price to be given based on the segments user belong to.
for example : if user1 belongs to segment 1 and 2 then the price would be min(default_price,seg_price_1,seg_price_2)
and if user2 belongs to segments 2 and 3 then the price shown to him would be min(default_price,seg_price_2,seg_price_3)
now showing this price is not a problem neither is sorting. The problem is i want to facet based on these fields. Originally we have a field called price_range.
price_range: "100-500"
this field is a string and points to the default price. we use this field in the faceting logic to calculate the count of products belonging to each pricerange. but now the users could be part of any combination of segments or not part any segment at all(default).
So now since price shown is dynamic based on the segments a particular user belongs to the counts based on faceting the price_range field would be wrong. Also we are getting this price_range field from another team and not a field we can afford to calculate runtime for each record for each user.
So to display the correct counts based on the dynamic prices shown to a user, what is the best way to handle this?
Please suggest.