> But you'd have to do result consolidation. That's what I'm trying to avoid. I could get a lot of hits (e.g. 100,000 hits) and will have to load all the documents to remove the duplicates.
> Subject: RE: Fields with multiple values... > Date: Wed, 11 Feb 2009 18:06:28 -0500 > From: sar...@syr.edu > To: java-user@lucene.apache.org > > Hi Dragon Fly, > > You could split the original document into multiple Lucene Documents, > one for each array index, all sharing the same "DocID" field value. > > Then your queries "just work". But you'd have to do result > consolidation, removing duplicate original docs when you get matches at > multiple array indexes from the same original doc. > > Steve > > On 2/11/2009 at 5:56 PM, Dragon Fly wrote: > > Hi, > > > > Let's say I have a single document with 2 fields (namely Field1 and > > Field2). 2 values are added to each field like below. > > > > // Add 2 values to Field1. > > doc.Add (new Field ("Field1", "A", Field.Store.YES, > > Field.Index.UN_TOKENIZED)); > > doc.Add (new Field ("Field1", "B", Field.Store.YES, > > Field.Index.UN_TOKENIZED)); > > > > // Add 2 values to Field2. > > doc.Add (new Field ("Field2", "C", Field.Store.YES, > > Field.Index.UN_TOKENIZED)); > > doc.Add (new Field ("Field2", "D", Field.Store.YES, > > Field.Index.UN_TOKENIZED)); > > > > I'd like to get a hit if I do: > > Field1:A AND Field2:C > > This is fine because that's how Lucene works. However, I do not want > > to get a hit if I do: > > Field1:A AND Field2:D > > The reason that I don't want a hit is because A is the first element > in > > Field1 and D is the second element in Field2. I only want a hit when > > both values are at the same array index. Is there a way to do this? > > Thank you in advance for your help. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > _________________________________________________________________ Windows Liveā¢: E-mail. Chat. Share. Get more ways to connect. http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_AE_Faster_022009