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 84E9D1014E for ; Wed, 5 Jun 2013 12:41:51 +0000 (UTC) Received: (qmail 92286 invoked by uid 500); 5 Jun 2013 12:41:48 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 91843 invoked by uid 500); 5 Jun 2013 12:41:47 -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 91835 invoked by uid 99); 5 Jun 2013 12:41:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 12:41:47 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of brendan.grainger@gmail.com designates 209.85.192.169 as permitted sender) Received: from [209.85.192.169] (HELO mail-pd0-f169.google.com) (209.85.192.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 12:41:43 +0000 Received: by mail-pd0-f169.google.com with SMTP id y10so1784553pdj.14 for ; Wed, 05 Jun 2013 05:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ORzq6aw4jw/hNWV7JQ/A9yLoWxa52/sXmwrWGUSG9m8=; b=HvcZGX8P9Fi4cTP/m9jrkoGrff8Zmxmj4JkWNBgrjqQIxMGGh/kfxSgjQ2yIVF/Yfs kBcicM+FDxWiQr59mHbvq3ocpkU3Zf3BGdNxfCG7cdjK5/xRxO5iZET+OM+TL35vZVFP p0+JgO2zmOexRWshSDTPtfiBJNWp7ullkgM8nQn7nNlyQ4l4DJo4DlGAJAJDmBVHsZ2A bqeVygyvS8xHxL4LjC3tCRBdZH2517TPqp4d9+/4cAxmhtVr4KLYTzYr/U8FJpeT3ntb oBpepjBaSJ08mF7EVPqDCj4OAk8NhjturUGIz7w/zRbmuLLZ1iIzGSVuGwFSu9A6wvSa wgcQ== MIME-Version: 1.0 X-Received: by 10.66.232.40 with SMTP id tl8mr33845233pac.121.1370436083212; Wed, 05 Jun 2013 05:41:23 -0700 (PDT) Received: by 10.70.14.99 with HTTP; Wed, 5 Jun 2013 05:41:23 -0700 (PDT) In-Reply-To: References: Date: Wed, 5 Jun 2013 08:41:23 -0400 Message-ID: Subject: Re: Receiving unexpected Faceting results. From: Brendan Grainger To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=047d7b111b39ed6c9004de6783e5 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b111b39ed6c9004de6783e5 Content-Type: text/plain; charset=UTF-8 Hi Dotan, I think all you need to do is add: facet.mincount=1 i.e. select?q=*:*&fq=tags:dotan-*&facet=true&facet.field=tags& rows=0&facet.mincount=1 Note that you can do it per field as well: select?q=*:*&fq=tags:dotan-*&facet=true&facet.field=tags& rows=0&f.tags.facet.mincount=1 http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount On Wed, Jun 5, 2013 at 8:27 AM, Dotan Cohen wrote: > Consider the following Solr query: > select?q=*:*&fq=tags:dotan-*&facet=true&facet.field=tags&rows=0 > > The 'tags' field is a multivalue field. I would expect the previous > query to return only tags that begin with the string 'dotan-' such as: > dotan-home > dotan-work > ...but not strings which do not begin with (or even contain) the > string in question. > > However, I am getting these results: > > 14 > 13 > 0 > 0 > > > It _may_ be that the 'beer' and 'beatles' tags were once attached to > the same documents as are attached the 'dotan-home' and/or > 'dotan-work'. I've done a bit of experimenting on this Solr install, > so I cannot be sure. However, considering that they are in fact 0 > results for those two, I would not expect them to show up at all, even > if they ever were attached to (i.e. once a value in the multiValue > field) any of the results that match the filter query. > > So, the questions are: > 1) How can I check if ever the multiValue fields for a particular > document (given its uniqueKey id) ever contains a specific value. > Alternatively, how can I see all the values that the document ever had > for the field. I don't expect this to actually be possible, but I ask > if it is, i.e. by examining certain aspects of the Solr index with a > text editor. > > 2) If those spurious results are appearing does that mean necessarily > that those values for the multivalued field were in fact once in the > multivalued field for documents matching the filter query? Thus, the > answer to the previous question would be to simply run a query for the > id of the document in question, and facet on the multivalued field > with a large limit. > > 3) How to have Solr return only those faceting values for the field > that in fact begin with 'dotan-', even if a document has other tags > such as 'beatles'? > > 4) How to have Solr return only those faceting values which are larger > than 0? > > Thank you! > > -- > Dotan Cohen > > http://gibberish.co.il > http://what-is-what.com > -- Brendan Grainger www.kuripai.com --047d7b111b39ed6c9004de6783e5--