Return-Path: Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: (qmail 27228 invoked from network); 1 Mar 2011 22:47:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Mar 2011 22:47:30 -0000 Received: (qmail 85298 invoked by uid 500); 1 Mar 2011 22:47:28 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 85227 invoked by uid 500); 1 Mar 2011 22:47: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 85218 invoked by uid 99); 1 Mar 2011 22:47:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2011 22:47:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [130.56.64.136] (HELO anumail9.anu.edu.au) (130.56.64.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2011 22:47:19 +0000 Received: from mailout2.anu.edu.au (mailout2.anu.edu.au [130.56.64.233]) by anumail9.anu.edu.au (8.14.4/8.14.4) with ESMTP id p21MkuCb021505 for ; Wed, 2 Mar 2011 09:46:56 +1100 (EST) Received: from mailout2.anu.edu.au (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id AB0EB9E8367 for ; Wed, 2 Mar 2011 09:46:56 +1100 (EST) Received: from smtphost.anu.edu.au (ds1.anu.edu.au [130.56.64.53]) by mailout2.anu.edu.au (Postfix) with ESMTP id DF11A9E8300 for ; Wed, 2 Mar 2011 09:46:55 +1100 (EST) Received: from messaging4.anu.edu.au (messaging4.anu.edu.au [130.56.64.74]) by smtphost.anu.edu.au (8.14.4/8.14.4) with ESMTP id p21Mkth9024595 for ; Wed, 2 Mar 2011 09:46:55 +1100 (EST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from adb227-34.anu.edu.au ([150.203.227.34]) by messaging4.anu.edu.au (Sun Java(tm) System Messaging Server 7u2-12.01 32bit (built Aug 26 2010)) with ESMTPSA id <0LHE0083UHY3XTD0@messaging4.anu.edu.au> for solr-user@lucene.apache.org; Wed, 02 Mar 2011 09:46:55 +1100 (EST) Message-id: <4D6D775B.1060900@anumail.anu.edu.au> Date: Wed, 02 Mar 2011 09:46:51 +1100 From: Scott Yeadon User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8 To: solr-user@lucene.apache.org Cc: iorixxx@yahoo.com Subject: Re: Query on multivalue field References: <824054.72503.qm@web121704.mail.ne1.yahoo.com> In-reply-to: <824054.72503.qm@web121704.mail.ne1.yahoo.com> X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.3.1.224223 internal X-PMX-Outbound: anu.edu.au X-PMX-Info: authenticated X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1400_1499 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, FROM_EDU_TLD 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SPEAR_FROM_ADDR_A 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' The only trick with this is ensuring the searches return the right results and don't go across value boundaries. If I set the gap to the largest text size we expect (approx 5000 chars) what impact does such a large value have (i.e. does Solr physically separate these fragments in the index or just apply the figure as part of any query? Scott. On 2/03/11 9:01 AM, Ahmet Arslan wrote: >> In a multiValued field, call it field1, if I have two >> values indexed to >> this field, say value 1 = "some text...termA...more text" >> and value 2 = >> "some text...termB...more text" and do a search such as >> field1:(termA termB) >> (where) I'm >> getting a hit >> returned even though both terms don't occur within a single >> value in the >> multiValued field. >> >> What I'm wondering is if there is a way of applying the >> query against >> each value of the field rather than against the field in >> its entirety. >> The reason being is the number of values I want to store is >> variable and >> I'd like to avoid the use of dynamic fields or >> restructuring the index >> if possible. > Your best bet can be using positionIncrementGap and to issue a phrase query (implicit AND) with the appropriate slop value. > > Ff you have positionIncrementGap="100", you can simulate this with using > &q=field1:"termA termB"~100 > > http://search-lucene.com/m/Hbdvz1og7D71/ > > > >