Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C34DEA4F for ; Mon, 25 Feb 2013 14:06:52 +0000 (UTC) Received: (qmail 76555 invoked by uid 500); 25 Feb 2013 14:06:48 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 76511 invoked by uid 500); 25 Feb 2013 14:06:48 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 76497 invoked by uid 99); 25 Feb 2013 14:06:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 14:06:48 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.215.49] (HELO mail-la0-f49.google.com) (209.85.215.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 14:06:42 +0000 Received: by mail-la0-f49.google.com with SMTP id fs13so2651345lab.22 for ; Mon, 25 Feb 2013 06:06:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding :x-gm-message-state; bh=arUE0A1/cdkUHgMyqpwfN9/H+9+S+8hwkbl6dUUVv8M=; b=DZfRg2yXYCB5ArW8J6YrtB9AjffHsaFxW1GLwzGLFqs0WsdRhN6j70Q+63tm7ttDlp H3qWDf8gUJkWxXmJttL/mdVSlCdShyxK6lHOTjGv4wsuHTfHNn8mN29WjynQ3mDdh/ll 1jP5fJJ5McgRH/d7dV2a6f4G5hYBdRGYJCMD40rGWJ6XAQPLVAdYi+NnUwWaI3pIrOdW nkcMg5+dDwR6sIhaqiUwa7i1APPUuVqIiZp9JNpOBxAaNYX9nqTbKTFCO4wA49evPo2n JA7DseMsfV6pd7ktcGc/ZpwUBpLmvKjAGENAp9u2/Z/Y90TAhFFCFFqYFzv+azAFN4JM Fe4g== X-Received: by 10.112.100.41 with SMTP id ev9mr4573831lbb.34.1361801181119; Mon, 25 Feb 2013 06:06:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.28.71 with HTTP; Mon, 25 Feb 2013 06:06:00 -0800 (PST) In-Reply-To: <1361793704420-4042700.post@n3.nabble.com> References: <1361793704420-4042700.post@n3.nabble.com> From: Michael Della Bitta Date: Mon, 25 Feb 2013 09:06:00 -0500 Message-ID: Subject: Re: Many(one)-to-many relationship problems To: solr-user@lucene.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmsIeVIHB4nFuAyNJmKHurqbKeBAxJCVcjGYSzRq80xSF40EAp9z0zxsK6vIWSNu6u7QJnU X-Virus-Checked: Checked by ClamAV on apache.org 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=92t a Game On Mon, Feb 25, 2013 at 7:01 AM, ipuskaric 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 (an= d > to sort by price) for products that matched some user criteria(e.g. inclu= de > in search only product package that is from user's region and only for hi= s > 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 wh= at > 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.