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 7D60E3521 for ; Thu, 28 Apr 2011 13:07:08 +0000 (UTC) Received: (qmail 68913 invoked by uid 500); 28 Apr 2011 13:07:05 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 68862 invoked by uid 500); 28 Apr 2011 13:07:05 -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 68854 invoked by uid 99); 28 Apr 2011 13:07:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 13:07:05 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [128.220.161.140] (HELO ipex3.johnshopkins.edu) (128.220.161.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 13:06:58 +0000 X-IronPort-AV: E=Sophos;i="4.64,280,1301889600"; d="scan'208";a="100709037" Received: from jhemtexhub3.win.ad.jhu.edu (HELO exchange.johnshopkins.edu) ([10.181.168.114]) by ipex3.johnshopkins.edu with ESMTP/TLS/RC4-MD5; 28 Apr 2011 09:06:37 -0400 Received: from JHEMTEBEX4.win.ad.jhu.edu (10.15.226.27) by JHEMTEXHUB3.win.ad.jhu.edu (10.181.168.114) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 28 Apr 2011 09:06:37 -0400 Received: from JHEMTEBEX1.win.ad.jhu.edu ([169.254.10.196]) by JHEMTEBEX4.win.ad.jhu.edu ([10.15.226.27]) with mapi id 14.01.0218.012; Thu, 28 Apr 2011 09:06:37 -0400 From: Jonathan Rochkind To: "solr-user@lucene.apache.org" Subject: RE: fq parameter with partial value Thread-Topic: fq parameter with partial value Thread-Index: AQHMBXNa+G1TursF3U2qHA94yCi9sZRzKeuAgAAlXACAACrIgIAAB3yA//+9RrQ= Date: Thu, 28 Apr 2011 13:06:37 +0000 Message-ID: <665DBC51D0250A47B4F9306CE71E5FB705DF7F@JHEMTEBEX1.win.ad.jhu.edu> References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.181.198.30] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Yep, what you describe is what I do in similar situations, it works fine. = =0A= =0A= It is certainly possible to facet on a tokenized field... but your individu= al facet values will be the _tokens_, not the complete values. And they'll = be the post-analyzed tokens at that. Which is rarely what you want. Thus = the use of two fields, one tokenized and analyzed, one not tokenized and mi= nimimally analzyed (for instance, not stemmed). =0A= ________________________________________=0A= From: elisabeth benoit [elisaelisaelisa@gmail.com]=0A= Sent: Thursday, April 28, 2011 9:03 AM=0A= To: solr-user@lucene.apache.org=0A= Subject: Re: fq parameter with partial value=0A= =0A= yes, the multivalued field is not broken up into tokens.=0A= =0A= so, if I understand well what you mean, I could have=0A= =0A= a field CATEGORY with multiValued=3D"true"=0A= a field CATEGORY_TOKENIZED with multiValued=3D" true"=0A= =0A= and then some POI=0A= =0A= POI_Name=0A= ...=0A= Restaurant Hotel=0A= Restaurant=0A= Hotel=0A= =0A= do faceting on CATEGORY and fq on CATEGORY_TOKENIZED.=0A= =0A= But then, wouldn't it be possible to do faceting on CATEGORY_TOKENIZED?=0A= =0A= Best regards=0A= Elisabeth=0A= =0A= =0A= 2011/4/28 Erick Erickson =0A= =0A= > So, I assume your CATEGORY field is multiValued but each value is not=0A= > broken up into tokens, right? If that's the case, would it work to have a= =0A= > second field CATEGORY_TOKENIZED and run your fq against that=0A= > field instead?=0A= >=0A= > You could have this be a multiValued field with an increment gap if you= =0A= > wanted=0A= > to prevent matches across separate entries and have your fq do a proximit= y=0A= > search where the proximity was less than the increment gap....=0A= >=0A= > Best=0A= > Erick=0A= >=0A= > On Thu, Apr 28, 2011 at 6:03 AM, elisabeth benoit=0A= > wrote:=0A= > > Hi Stefan,=0A= > >=0A= > > Thanks for answering.=0A= > >=0A= > > In more details, my problem is the following. I'm working on searching= =0A= > > points of interest (POIs), which can be hotels, restaurants, plumbers,= =0A= > > psychologists, etc.=0A= > >=0A= > > Those POIs can be identified among other things by categories or by=0A= > brand.=0A= > > And a single POIs might have different categories (no maximum number).= =0A= > User=0A= > > might enter a query like=0A= > >=0A= > >=0A= > > McDonald=92s Paris=0A= > >=0A= > >=0A= > > or=0A= > >=0A= > >=0A= > > Restaurant Paris=0A= > >=0A= > >=0A= > > or=0A= > >=0A= > >=0A= > > many other possible queries=0A= > >=0A= > >=0A= > > First I want to do a facet search on brand and categories, to find out= =0A= > which=0A= > > case is the current case.=0A= > >=0A= > >=0A= > > http://localhost:8080/solr /select?q=3Drestaurant paris=0A= > > &facet=3Dtrue&facet.field=3DBRAND& facet.field=3DCATEGORY=0A= > >=0A= > > and get an answer like=0A= > >=0A= > > =0A= > >=0A= > > =0A= > >=0A= > > 598=0A= > >=0A= > > 451=0A= > >=0A= > >=0A= > >=0A= > > Then I want to send a request with fq=3D CATEGORY: Restaurant and still= get=0A= > > answers with CATEGORY=3D Restaurant Hotel.=0A= > >=0A= > >=0A= > >=0A= > > One solution would be to modify the data to add a new document every ti= me=0A= > we=0A= > > have a new category, so a POI with three different categories would be= =0A= > index=0A= > > three times, each time with a different category.=0A= > >=0A= > >=0A= > > But I was wondering if there was another way around.=0A= > >=0A= > >=0A= > >=0A= > > Thanks again,=0A= > >=0A= > > Elisabeth=0A= > >=0A= > >=0A= > > 2011/4/28 Stefan Matheis =0A= > >=0A= > >> Hi Elisabeth,=0A= > >>=0A= > >> that's not what FilterQueries are made for :) What against using that= =0A= > >> Criteria in the Query?=0A= > >> Perhaps you want to describe your UseCase and we'll see if there's=0A= > >> another way to solve it?=0A= > >>=0A= > >> Regards=0A= > >> Stefan=0A= > >>=0A= > >> On Thu, Apr 28, 2011 at 9:09 AM, elisabeth benoit=0A= > >> wrote:=0A= > >> > Hello,=0A= > >> >=0A= > >> > I would like to know if there is a way to use the fq parameter with = a=0A= > >> > partial value.=0A= > >> >=0A= > >> > For instance, if I have a request with fq=3DNAME:Joe, and I would li= ke=0A= > to=0A= > >> > retrieve all answers where NAME contains Joe, including those with= =0A= > NAME =3D=0A= > >> > Joe Smith.=0A= > >> >=0A= > >> > Thanks,=0A= > >> > Elisabeth=0A= > >> >=0A= > >>=0A= > >=0A= >=0A=