lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Rhodes" <jrrho...@gmail.com>
Subject 2.0 and Tokenized versus UN_TOKENIZED
Date Sat, 04 Nov 2006 22:19:51 GMT
I'm using the 2.0 branch and I've had issues with searching indexes where
the fields aren't tokenized.
For instance, my index consists of count,lastname,city,state and I used the
following code to index it (the data is in a sql server db):
*

if*(count != 0) {

doc.add(*new* Field("count", NumberUtils.*pad*(count), Field.*Store*.*YES*,
Field.Index.*TOKENIZED*));

}

*if*(lastName != *null*) {

doc.add(*new* Field("lastname", lastName, Field.Store.*YES*, Field.Index.*
TOKENIZED*,Field.TermVector.*YES*));

}

*if*(city != *null*) {

doc.add(*new* Field("city", city, Field.Store.*YES*, Field.Index.*UN_**
TOKENIZED*));

}

*if*(state != *null*) {

*doc*.add(*new* Field("*state*", state, Field.Store.*YES*, Field.Index.*
TOKENIZED*));

}

*Using this code I can search by any field with my app EXCEPT city, though I
see it in the index using Luke.  I also can't search for it using Luke. When
I add Field.Index.TOKENIZED  to the city field, I can search by it fine.*

*Is this normal behavior? This doesn't make sense to me. Tokenized should
prevent me from searching unless I'm missing something. Any ideas? Thanks!*

*B*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message