Hello Puska, I might not have understood your requirements, but if for a given user, there's only one package per product that should ever be retrieved, I'd make the document represent one package/price combination, and then use a filter query to ensure the user's searches only retrieve package/prices that are relevant for their region. Then you can sort on price correctly, since it would only have a single value per document.
Michael Della Bitta ------------------------------------------------ Appinions 18 East 41st Street, 2nd Floor New York, NY 10017-6271 www.appinions.com Where Influence Isn’t a Game On Mon, Feb 25, 2013 at 7:01 AM, ipuskaric <ivan.puska...@gmail.com> wrote: > Let's say I have model in my db like this: > product:n <-----> n:package > Product properties are: name, package ids. > Package properties are: price, region, subscription. > If the user requirement is to show all product data and product price (and > to sort by price) for products that matched some user criteria(e.g. include > in search only product package that is from user's region and only for his > subscription) can it be done in Solr? > So it means that only one package is user's package, and price written in > that package is 'real' price for that user. > I know that Solr's model is flat and I can't do relational things, but what > is the 'best' solution for this...? > I saw some responses saying to store only min and max price... > With Solr join I can do, for example, filtering on packages and then make > join to products, and return products as response. But with joins I can't > return price and sort by it. > > Any ideas? > > Thanks, > Puska. > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Many-one-to-many-relationship-problems-tp4042700.html > Sent from the Solr - User mailing list archive at Nabble.com.