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 A15F31885B for ; Thu, 21 Jan 2016 15:43:30 +0000 (UTC) Received: (qmail 58842 invoked by uid 500); 21 Jan 2016 15:43:27 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 58776 invoked by uid 500); 21 Jan 2016 15:43:27 -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 58764 invoked by uid 99); 21 Jan 2016 15:43:27 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2016 15:43:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 8D08B1A06A8 for ; Thu, 21 Jan 2016 15:43:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=uberresearch-com.20150623.gappssmtp.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id HUuiijBIbjRH for ; Thu, 21 Jan 2016 15:43:19 +0000 (UTC) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id D5AF3203BE for ; Thu, 21 Jan 2016 15:43:18 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id l65so225318103wmf.1 for ; Thu, 21 Jan 2016 07:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uberresearch-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=WDwSA4BLR+NWpLseczP+lOGkADnbidWh6xLxaRd/m1E=; b=S1E8Et3SnGrnB/f1uT3fu240lj6hYtBMM6hbya7/vhjrNsPBCRY5ilQxa15zD9fbr1 wGaTPz0lM++oniyq+FXuJ31FmrKLDCD7XjE8uI74McUWgIyLD7d0hurvqEthL8GwrPfx 7EiXiJIA44KgvezGUoR+IEgah5hs84Sebhm+dhBJtlzE4zTI3a5CCDJBhzCmJMfwxkwv YAhaN9EBIR2hT1H9M1OhVSchJKq8fxuq4uFmYcqQC3lOT8TvUe0wAEsU6YBTovFHEqDq KipwGbMXWhWY0XFwZ5hpEa7F/wxH68p5TpGTCcqI81N13dkgFPCX4pe510vG178tY8oi zRZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=WDwSA4BLR+NWpLseczP+lOGkADnbidWh6xLxaRd/m1E=; b=KJI1AONY9iGGoMq3LYRpR7KUU26FTsqhMjpDDsm42B3hJvbWVwhBGFC5MC3wD/JbXE 43g2DeXPMNEpEMIVB2WrB0r/0EnNxYHk1qwdWiipEcd+GIVVNVIQN8TxpUoZncImjKbx eNDyXkSvss0X1JDEAdzaM+9mSgIq73LVO2kFRifqdzXiNS9A9NBk+kHm0UO3YWrlOGs1 3tq8VAxPqoQnpxM0cv29HB7/BxhUG8pA2Seab7Wnj8FXcDszRQcEQglkA2JKQd+dFeKm EKH7Wxa5n6S0AjjlJEXpiSRlYnBtoYoAKRYE1GlbpZWaAnPgBNspujSOTd2MeE0BZHDX uYRw== X-Gm-Message-State: AG10YOQIn3c30MNI5VQFgfmrO/r7EtUyl2/P1hP5y/4JSGAeduo9Z9GRJw134o9LlVsZBTDz X-Received: by 10.28.232.208 with SMTP id f77mr11558568wmi.34.1453390998413; Thu, 21 Jan 2016 07:43:18 -0800 (PST) Received: from [192.168.2.102] (dslb-088-067-095-172.088.067.pools.vodafone-ip.de. [88.67.95.172]) by smtp.googlemail.com with ESMTPSA id u69sm3455097wmu.20.2016.01.21.07.43.17 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 07:43:17 -0800 (PST) Subject: Re: Restricting/Filtering facet results To: solr-user@lucene.apache.org References: <56A0A0B5.9080505@uberresearch.com> From: Achim Domma Message-ID: <56A0FC94.4030706@uberresearch.com> Date: Thu, 21 Jan 2016 16:43:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit If I specify the query like this, I will get only one facet back. Or am I wrong? I would have to specify one query for UserB and one for UserC. My filter list can contain thousands of users, so specifying individual queries is not an option. On 21.01.2016 11:43, Binoy Dalal wrote: > The facet.query parameter is what you're looking for. > Use it like so: > &facet.query=field:(UserB OR UserC) > Check out the wiki for more details > > On Thu, 21 Jan 2016, 14:41 Achim Domma wrote: > >> Hi, >> >> is there some way to restrict/filter the facetting results? Our use case >> is the following: >> >> Our documents have a multi value field, which holds user ids, so the >> values might be like this: >> >> doc1 = ['UserA', 'UserB', 'UserC'] >> doc2 = ['UserA', 'UserB'] >> doc3 = ['UserA', 'UserC'] >> >> Now I execute a search using a filter which restricting to documents >> related to (UserB OR UserC). The result set will contain all three >> documents, so the facetting result will be >> >> UserA: 3 >> UserB: 2 >> UserC: 2 >> >> What I want to have is just: >> >> UserB: 2 >> UserC: 2 >> >> Is there some existing solution for that? I'm currently thinking about >> implementing a custom facet aggregation function, which only counts >> values in my reference set (UserB, UserC). I checked the code and it >> looks feasible, but I'm not (yet?) and expert of SOLR internals. >> >> Any hints, guidance, links to existing projects, patches, ... would be >> very appreciated. >> >> cheers, >> Achim >>