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 D3BA1DC79 for ; Sun, 8 Jul 2012 16:27:15 +0000 (UTC) Received: (qmail 46073 invoked by uid 500); 8 Jul 2012 16:27:12 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 46035 invoked by uid 500); 8 Jul 2012 16:27:12 -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 46027 invoked by uid 99); 8 Jul 2012 16:27:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jul 2012 16:27:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of erickerickson@gmail.com designates 209.85.214.176 as permitted sender) Received: from [209.85.214.176] (HELO mail-ob0-f176.google.com) (209.85.214.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jul 2012 16:27:07 +0000 Received: by obbtb18 with SMTP id tb18so12055362obb.35 for ; Sun, 08 Jul 2012 09:26:46 -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=pM3DEISL+QmmTUdurJ5JB3eRoq/fkkqsbBRSTugXF9s=; b=sj7mIRe1CA5Gk8fNVwcHDRJOfZcRYsAdMY4mkh84OzbBLuGuxMGaeI6OHEyD4zMT4M 9g74nPDdq/Qcj8VNo4HTGSK1GFBy2IQcT1l7pI81p4PpneFx06y6RNpn3y85O3ZPJyOQ zVhHgowRte3nKlH0d90+7UB+8nt5OGWVXBdf1Fr75TvJWhVzBvxwQiavE746SlkdLM8v FeqFvzZXswPbdnbR+SSH8Mt2GnenvR/k+fok8BQShEpqhvJy0P6IK1G7mI2iFonsbPxx M3ccI/pa6LzftQsXdzfRJUW5jI5zblIi4bEhbnhaJRjNZGvsLqjRIkDjVZlLJqM3FpXd +Rxg== MIME-Version: 1.0 Received: by 10.60.20.233 with SMTP id q9mr39044944oee.57.1341764806828; Sun, 08 Jul 2012 09:26:46 -0700 (PDT) Received: by 10.182.167.37 with HTTP; Sun, 8 Jul 2012 09:26:46 -0700 (PDT) In-Reply-To: References: Date: Sun, 8 Jul 2012 12:26:46 -0400 Message-ID: Subject: Re: solr facet fields doesn't honor fq From: Erick Erickson To: solr-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Solr faceting only counts documents that satisfy the query. Think of it as assembling a list of all possible values for a field and then adding 1 for each value found in each document that satisfies the overall query (including the filter query). So you can get counts of 0, that's expected. Adding mincount=1 will keep these from being returned. I suspect that your query is not finding the documents you think it is or your filter query is not parsed as you expect. If you add &debugQuery=on you'll see the parsed form of both. In particular, look for your complex fq to be broken up and distributed with some parts against your portal_uuid and some against the default search field. In particular, '+' and '-' are operators and the top-level parsers may be splitting these up. Quoting or parenthesizing may help. Best Erick On Sun, Jul 8, 2012 at 2:32 AM, Chamnap Chhorn wrote: > Hi all, > > I have a question related to solr 3.5 on field facet. Here is my query: > > http://localhost:8081/solr_new/select?tie=0.1&q.alt=*:*&q=bank&qf=nameaddress&fq= > *portal_uuid:+A4E7890F-A188-4663-89EB-176D94DF6774*&defType=dismax&* > facet=true*&facet.field=*location_uuid*&facet.field=*sub_category_uuids* > > What I get back with field facet are: > 1. Some location_uuids which is in the current portal_uuid (has facet count >> 0) > 2. Some location_uuids are not in the current portal_uuid at all (has facet > count = 0) > > It seems that solr doesn't honor the fq at all when returning field facet. > I need to add one more parameter "facet.mincount=1" in order to not return > location_uuids facet (2). > > I think, solr does faceting on all location_uuid. It should does that > scoping to current portal_uuid. Any idea? > > -- > Chhorn Chamnap > http://chamnap.github.com/