lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dragon Fly <dragon-fly...@hotmail.com>
Subject Fields with multiple values...
Date Wed, 11 Feb 2009 22:55:45 GMT

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.

_________________________________________________________________
Windows Liveā„¢: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_022009
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message