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 3A19F380F for ; Thu, 28 Apr 2011 20:14:14 +0000 (UTC) Received: (qmail 26401 invoked by uid 500); 28 Apr 2011 20:14:11 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 26354 invoked by uid 500); 28 Apr 2011 20:14:11 -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 26346 invoked by uid 99); 28 Apr 2011 20:14:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 20:14:11 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of erickerickson@gmail.com designates 209.85.216.48 as permitted sender) Received: from [209.85.216.48] (HELO mail-qw0-f48.google.com) (209.85.216.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 20:14:06 +0000 Received: by qwj9 with SMTP id 9so2074864qwj.35 for ; Thu, 28 Apr 2011 13:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=hD/CkWLONqvN1hjvOnF2cpxI3SN8VUNLEVSdRCJHx1k=; b=QAUY7c/ZcCNXPkT7RJLs75KV1EOIC6N/0J/m10eL+MSyILorR2E7ZikhdpcVjNLsyf LhOwGVRU9IsDl8qkn3/+P50WZj+qlJjYnve6zWFjHXVjGYjJTTlYBOiz4DIEfuucYRgy 4ACdjJQ3Z5JwfC8mWGf9v9FqpS0Jp8Cljcx/Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dnQvMewyPJ4m5CKDdwzZHv+frAn61x700aT+Y+c6C3dG7Zk0/eq93Ad0wbCSzxfDNl nDPGwjt8k/yyGudmx24l+hWSU9BTAQu2gJMMgWbbwlmSgkYFSI1YRCFgak61PhegAGmK f8kcicTNl7IapKGcKZAUyocYYf1IqPviIJMm0= MIME-Version: 1.0 Received: by 10.229.105.153 with SMTP id t25mr3255958qco.123.1304021625321; Thu, 28 Apr 2011 13:13:45 -0700 (PDT) Received: by 10.229.245.81 with HTTP; Thu, 28 Apr 2011 13:13:45 -0700 (PDT) In-Reply-To: References: Date: Thu, 28 Apr 2011 16:13:45 -0400 Message-ID: Subject: Re: fq parameter with partial value From: Erick Erickson To: solr-user@lucene.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable See below: On Thu, Apr 28, 2011 at 9:03 AM, elisabeth benoit wrote: > yes, the multivalued field is not broken up into tokens. > > so, if I understand well what you mean, I could have > > a field CATEGORY with =A0multiValued=3D"true" > a field CATEGORY_TOKENIZED with =A0multiValued=3D" true" > > and then some POI > > POI_Name > ... > Restaurant Hotel > Restaurant > Hotel [EOE] If the above is the document you're sending, then no. The document would be indexed with Restaurant Hotel Restaurant Hotel Or even just: Restaurant Hotel and set up a to copy the value from CATEGORY to CATEGORY_TOKENI= ZED. The multiValued part comes from: "And a single POIs might have different categories so your document could h= ave" which would look like: Restaruant Hotel Health Spa Dance Hall and your document would be counted for each of those entries while searches against CATEGORY_TOKENIZED would match things like "dance" "spa" etc. But do notice that if you did NOT want searching for "restaurant hall" (no quotes), to match then you could do proximity searches for less than your increment gap. e.g. (this time with the quotes) would be "restaurant hall"~50, which would then NOT match if your increment gap were 100. Best Erick > > do faceting on CATEGORY and fq on CATEGORY_TOKENIZED. > > But then, wouldn't it be possible to do faceting on CATEGORY_TOKENIZED? > > Best regards > Elisabeth > > > 2011/4/28 Erick Erickson > >> So, I assume your CATEGORY field is multiValued but each value is not >> broken up into tokens, right? If that's the case, would it work to have = a >> second field CATEGORY_TOKENIZED and run your fq against that >> field instead? >> >> You could have this be a multiValued field with an increment gap if you >> wanted >> to prevent matches across separate entries and have your fq do a proximi= ty >> search where the proximity was less than the increment gap.... >> >> Best >> Erick >> >> On Thu, Apr 28, 2011 at 6:03 AM, elisabeth benoit >> wrote: >> > Hi Stefan, >> > >> > Thanks for answering. >> > >> > In more details, my problem is the following. I'm working on searching >> > points of interest (POIs), which can be hotels, restaurants, plumbers, >> > psychologists, etc. >> > >> > Those POIs can be identified among other things =A0by categories or by >> brand. >> > And a single POIs might have different categories (no maximum number). >> User >> > might enter a query like >> > >> > >> > McDonald=92s Paris >> > >> > >> > or >> > >> > >> > Restaurant Paris >> > >> > >> > or >> > >> > >> > many other possible queries >> > >> > >> > First I want to do a facet search on brand and categories, to find out >> which >> > case is the current case. >> > >> > >> > http://localhost:8080/solr /select?q=3Drestaurant =A0paris >> > &facet=3Dtrue&facet.field=3DBRAND& facet.field=3DCATEGORY >> > >> > and get an answer like >> > >> > >> > >> > >> > >> > 598 >> > >> > 451 >> > >> > >> > >> > Then I want to send a request with fq=3D CATEGORY: Restaurant and stil= l get >> > answers with CATEGORY=3D Restaurant Hotel. >> > >> > >> > >> > One solution would be to modify the data to add a new document every t= ime >> we >> > have a new category, so a POI with three different categories would be >> index >> > three times, each time with a different category. >> > >> > >> > But I was wondering if there was another way around. >> > >> > >> > >> > Thanks again, >> > >> > Elisabeth >> > >> > >> > 2011/4/28 Stefan Matheis >> > >> >> Hi Elisabeth, >> >> >> >> that's not what FilterQueries are made for :) What against using that >> >> Criteria in the Query? >> >> Perhaps you want to describe your UseCase and we'll see if there's >> >> another way to solve it? >> >> >> >> Regards >> >> Stefan >> >> >> >> On Thu, Apr 28, 2011 at 9:09 AM, elisabeth benoit >> >> wrote: >> >> > Hello, >> >> > >> >> > I would like to know if there is a way to use the fq parameter with= a >> >> > partial value. >> >> > >> >> > For instance, if I have a request with fq=3DNAME:Joe, and I would l= ike >> to >> >> > retrieve all answers where NAME contains Joe, including those with >> NAME =3D >> >> > Joe Smith. >> >> > >> >> > Thanks, >> >> > Elisabeth >> >> > >> >> >> > >> >