Return-Path: Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: (qmail 32033 invoked from network); 20 Jan 2010 22:14:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jan 2010 22:14:51 -0000 Received: (qmail 62265 invoked by uid 500); 20 Jan 2010 22:14:48 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 62212 invoked by uid 500); 20 Jan 2010 22:14:48 -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 62202 invoked by uid 99); 20 Jan 2010 22:14:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jan 2010 22:14:48 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tommy.chheng@gmail.com designates 72.14.220.157 as permitted sender) Received: from [72.14.220.157] (HELO fg-out-1718.google.com) (72.14.220.157) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jan 2010 22:14:40 +0000 Received: by fg-out-1718.google.com with SMTP id e21so88692fga.5 for ; Wed, 20 Jan 2010 14:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=rwZruIELmA0+kFd9aWXMDIG1sexDjNf0Ny0K7K8wSQM=; b=SWzS0VUpCPBSl+hWZ1J9C7Sfu25UZjkk79voPLmSxqFfBEJ4uOzIGR9Gx5NH1H0c2H 8BvyWivYa9jZkOz6GCqDGUfEH4iHB6vUftIp01AAqgsTa8c3noRivWlE8nlut78IbQMr DRQhB4uq2Ptql2q3ef1YjQvNSK7bYsblslFMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=pM035bnl5KtOWvAsH0nQHKnqmhR7iD1x5mZ3AOBGNAXwdfUZiBfPNR5Uc+Yix/9068 AH+10dIu3c9mLMG3qBKRdTy73sIIbeCxIoaQHPQrCcc6MKBskdQbDw+oZ1aBONi3aIjn 5pOBWFmRQ/S2R9jI6WUavwz0xkH7hrYhmsyxk= Received: by 10.87.69.17 with SMTP id w17mr1082240fgk.41.1264025659187; Wed, 20 Jan 2010 14:14:19 -0800 (PST) Received: from thinktank.local (c114-76-51-206.eburwd4.vic.optusnet.com.au [114.76.51.206]) by mx.google.com with ESMTPS id e11sm1067041fga.29.2010.01.20.14.14.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 20 Jan 2010 14:14:18 -0800 (PST) Message-ID: <4B578033.8080106@gmail.com> Date: Wed, 20 Jan 2010 14:14:11 -0800 From: Tommy Chheng User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: solr-user@lucene.apache.org Subject: Re: filter querying working on dynamic int fields but not dynamic string fields? References: <4B577531.9040202@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Thanks, quoting it fixed it. I'm also going to strip the leading/trailing whitespace at index time. Tommy On 1/20/10 1:47 PM, Erik Hatcher wrote: > > On Jan 20, 2010, at 4:27 PM, Tommy Chheng wrote: > >> I'm having trouble doing a filter query on a string field. Any ideas >> why it's working on dynamic int fields but not dynamic string fields? >> >> ex. >> http://localhost:8983/solr/select?indent=on&version=2.2&q=climate - >> correct >> http://localhost:8983/solr/select?version=2.2&q=climate&fq=awardedamounttodate_i%3A88900 FQ >> with dynamic int field returns one result - correct >> http://localhost:8983/solr/select?indent=on&version=2.2&q=climate&fq=awardinstrument_s:Continuing+grant returns >> zero results - Incorrect > > fq=field:value with spaces > > is problematic - it is being parsed as a SolrQueryParser expression. > It should work if you quote it - fq=field:"value with spaces" > > However, as I mentioned earlier today on the list, I think the best > option for facet narrowing on string fields is this: > > fq={!raw f=field}value with spaces > > Of course all of the above need to be URL encoded too. > >> +awardinstrument_s:Continuing +text:grant > > This explains the problem exactly. Note how it parsed the second word > to the text field, not the field you specified. > > Erik > >