RE: Fields with multiple values...

2009-02-12 Thread Dragon Fly
I'll think about your ideas and see which one works best for my project. Thank you. > Date: Wed, 11 Feb 2009 18:11:58 -0700 > Subject: Re: Fields with multiple values... > From: mark.a.fergu...@gmail.com > To: java-user@lucene.apache.org > > One approach is to use dyn

Re: Fields with multiple values...

2009-02-11 Thread Mark Ferguson
One approach is to use dynamic fields, making the value of the second field part of the name of the first field. So for example, you would have: doc.Add (new Field ("Field1_A", "C", Field.Store.YES, Field.Index.UN_TOKENIZED)); doc.Add (new Field ("Field1_B", "D", Field.Store.YES, Field.Index.UN_TO

Re: Fields with multiple values...

2009-02-11 Thread Paul Cowan
Dragon Fly wrote: 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 el

Re: Fields with multiple values...

2009-02-11 Thread Erick Erickson
Well, you could index with your index as part of the value... doc.Add (new Field ("Field1", "1A", Field.Store.YES, Field.Index.UN_TOKENIZED)); doc.Add (new Field ("Field1", "2B", Field.Store.YES, Field.Index.UN_TOKENIZED)); // Add 2 values to Field2. doc.Add (new Field ("Field2", "1C", Field.Store

RE: Fields with multiple values...

2009-02-11 Thread Dragon Fly
> 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

RE: Fields with multiple values...

2009-02-11 Thread Steven A Rowe
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 arr

Fields with multiple values...

2009-02-11 Thread Dragon Fly
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.Ind