If I understood correctly, you should be done with MultiFieldQueryParser Eduardo
-----Original Message----- From: Mark Harwood [mailto:markharw...@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" <hgbir...@t-online.de> 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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org