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 1672411146 for ; Fri, 18 Jul 2014 04:59:34 +0000 (UTC) Received: (qmail 72569 invoked by uid 500); 18 Jul 2014 04:59:30 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 72505 invoked by uid 500); 18 Jul 2014 04:59:30 -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 72493 invoked by uid 99); 18 Jul 2014 04:59:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jul 2014 04:59:29 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of umesh.iitk@gmail.com designates 209.85.218.43 as permitted sender) Received: from [209.85.218.43] (HELO mail-oi0-f43.google.com) (209.85.218.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jul 2014 04:59:25 +0000 Received: by mail-oi0-f43.google.com with SMTP id u20so1693833oif.2 for ; Thu, 17 Jul 2014 21:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=lTvanvlCCu1rMYWiA/IEWXSdGVAg2EIkLZ6jasG7Ap0=; b=CYYC5/5GKRTQLLXP2WpHt9tZymQ/GQB4XjcO0a9jBWj0tmSktuRg4NQ0w3SM9w9/Y9 3g6dRSMN4LTZJmSihSBsXHsxaCd+DT1dKY1nx6Yw2sm40tIKHhUXly1IIuPln2BO9mWQ Vrh6nc4IjZykJlJZFrAlEjbNcjFDsXqnhO0mlTZ5z0KBN8uynfffMwSNJa+5Mw/4Y0lw BQCmkAANd0Kg+Kq2vu8EkWVYmIQXPqK1eio5paDaG07N+AwefrgymncSyUNFLpWZx+Ox KokSlrkpMp2TDsIQzh9MUGuCRtmuLCVAU8Zmju7upKkD+/nP0Ja1XCuE7qa+030JrJhD JGVg== X-Received: by 10.182.233.230 with SMTP id tz6mr2380774obc.53.1405659544721; Thu, 17 Jul 2014 21:59:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.137.17 with HTTP; Thu, 17 Jul 2014 21:58:44 -0700 (PDT) In-Reply-To: References: From: Umesh Prasad Date: Fri, 18 Jul 2014 10:28:44 +0530 Message-ID: Subject: Re: How do I get faceting to work with Solr JOINs To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a11c30012d6a1a404fe709d76 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c30012d6a1a404fe709d76 Content-Type: text/plain; charset=UTF-8 Hi Vinay, You can customize the FacetsComponent. Basically FacetComponent uses SimpleFacets to compute the facet count. It passes matched docset present in responsebuilder to SimpleFacets's constructor. 1. Build a mapping between parent space and auxiliary document space in (say an int array) and cache it in your own custom cache in SolrIndexSearcher. You will need to rebuild this mapping on every commit have to define a CacheRegenerator for that. 2. You can map the matched docset (which is in parent space) to auxiliary document space. The catch is that facets from non matching auxililary docs also would be counted. 3. You can then pass on this mapped auxiliary document to SimpleFacets for faceting. I have doing something similar for our needs .. Basically, we have a parent document with text attributes and changes very less. And we have child documents with inventory attributes which changes extremely fast. The search results requires child documents but faceting has to be done on text attributes which belong to parents. So we do this mapping by customizing the FacetComponent. On 18 July 2014 04:11, Vinay B, wrote: > Some Background info : > In our application, we have a requirement to update large number of records > often. I investigated solr child documents but it requires updating both > the child and the parent document . Therefore, I'm investigating adding > frequently updated information in an "auxillary document" with a custom > defined "parent-id" field that can be used to join with the static "parent > document". - basically rolling my own child document functionality. > > This approach has satisfied all my requirements, except one. How can I > facet upon a field present in the auxillary document? > > First, here's a gist dump of my test core index (4 docs + 4 aux docs) > https://gist.github.com/anonymous/2774b54e667778c71492 > > Next, here's a simple facet query only on the aux . While this works, it > only returns auxillary documents > https://gist.github.com/anonymous/a58b87576b895e467c68 > > Finally, I tweak the query using a SOLR join ( > https://wiki.apache.org/solr/Join ) to return the main documents (which it > does), but the faceting returns no results. This is what I'm hoping someone > on this list can answer . > Here is the gist of that query > https://gist.github.com/anonymous/f3a287ab726f35b142cf > > Any answers, suggestions ? > > Thanks > -- --- Thanks & Regards Umesh Prasad --001a11c30012d6a1a404fe709d76--