Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 75745 invoked from network); 9 Jul 2010 18:39:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jul 2010 18:39:09 -0000 Received: (qmail 46881 invoked by uid 500); 9 Jul 2010 18:39:07 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 46787 invoked by uid 500); 9 Jul 2010 18:39:06 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 46779 invoked by uid 99); 9 Jul 2010 18:39:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 18:39:06 +0000 X-ASF-Spam-Status: No, hits=1.0 required=10.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of eduardop@occ.com.mx does not designate 97.65.90.20 as permitted sender) Received: from [97.65.90.20] (HELO srvestadisticas.occprod.com) (97.65.90.20) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 18:38:58 +0000 Received: from occm01 ([10.10.79.169]) by srvestadisticas.occprod.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 9 Jul 2010 13:45:01 -0500 From: "Eduardo Pierdant" To: References: <48B0AA1D72D74BCC938101DEE10AD5E2@HGBT400S> <07EFFA33-F21C-493F-B5B2-B1F06CC27E2E@yahoo.co.uk> In-Reply-To: <07EFFA33-F21C-493F-B5B2-B1F06CC27E2E@yahoo.co.uk> Subject: RE: Searching docs with multi-value fields Date: Fri, 9 Jul 2010 13:38:32 -0500 Organization: OCCMundial Message-ID: <04b901cb1f95$efb2c610$cf185230$@occ.com.mx> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQInIj2ta9wGbDrNxWsDSaqucbMwRwL0grs3kdlDKhA= Content-Language: es-mx X-OriginalArrivalTime: 09 Jul 2010 18:45:01.0827 (UTC) FILETIME=[D6BA2530:01CB1F96] X-Virus-Checked: Checked by ClamAV on apache.org If I understood correctly, you should be done with MultiFieldQueryParser Eduardo -----Original Message----- From: Mark Harwood [mailto:markharw00d@yahoo.co.uk] Sent: viernes, 09 de julio de 2010 09:30 a.m. To: java-user@lucene.apache.org Subject: Re: Searching docs with multi-value fields Check out lucene 2454 and accompanying slide show if your reason for doing this is modelling repeating elements. ---------------------------------------- On 9 Jul 2010, at 13:43, "Hans-Gunther Birken" wrote: > I'm examining the following search problem. Consider a document with > two multi-value fields. > > > > Document doc = new Document(); > > > > doc.add(new Field("f1", "a1", Field.Store.YES, Field.Index.ANALYZED)); > doc.add(new Field("f1", "a2", Field.Store.YES, Field.Index.ANALYZED)); > doc.add(new Field("f1", "a3", Field.Store.YES, Field.Index.ANALYZED)); > > > > doc.add(new Field("f2", "b1", Field.Store.YES, Field.Index.ANALYZED)); > doc.add(new Field("f2", "b2", Field.Store.YES, Field.Index.ANALYZED)); > doc.add(new Field("f2", "b3", Field.Store.YES, Field.Index.ANALYZED)); > > > > The following search expression is applied: > > f1:ax AND f2:by > > where x, y is 1,2, or 3. > > > > Thus the search condition f1:a2 AND f2:b2 should return the above > document whereas the condition f1:a1 AND f2:b2 should return no > result. Thus the search should return the document if and only if > the conditions of each field are satisfied at the same "index" level. > > > > Does anyone have an idea how to solve this problem using Lucene/Java? > > > > Thanks > > HGB > > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org