I'm looking for a strategy to present a individual user's rating on a solr document. ie. Users get to put give a rating 1-5 on a document and I want to present that back to them as they search.
I can think of two general approaches.
Store the ratings in my RDBMS and query it after getting solr results and merge the data in business logic.
Somehow also store this rating info in solr so it comes back with the data for a given user. All I can think of is attributes names with the userid and a value of rating.
Assuming a large user base, I worry approach 2 could get out of hand. How "wide" can you go with a solr document? Can you put tens of thousands of attributes on a document? Would the performance impact still leave approach 2 better than a second hit on a sql db(approach 1)?
Are there other approaches I'm not thinking of?