lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luther blisset <>
Subject Removing diacritics with ISOLatin1AccentFilter
Date Fri, 24 Jul 2009 09:41:45 GMT

Hi folks,
I just upgrading Hibernate Search library of my app and so I had to upgrade
Lucene too and pass from 2.2 to 2.4 version.
In Lucene 2.4 the ISOLatin1AccentFilter class has changed and I can't figure
how it works.
I use a TwoWayFieldBridge to index the data and this is my set method:

public void set(String s, Object o, Document document, Field.Store store,
Field.Index index, Float aFloat){

	//MyObject has a field name
        MyObject objectToIndex;

	//casting from Object to MyObject
            objectToIndex = MyObject.class.cast(o);
        }catch(ClassCastException cEx ){}

        if (objectToIndex.getName() != null) {
            ISOLatin1AccentFilter filter = new ISOLatin1AccentFilter(new
StandardTokenizer(new StringReader(objectToIndex.getName())));
            Field name = new Field( "name",
String.valueOf(objectToIndex.getName()).toLowerCase() , Field.Store.YES,
Field.Index.UN_TOKENIZED );


but it doesn't work. And if pass an accented word for the property
objectToIndex.getName(), it remains with accent :(
I think there is something wrong in my code when I create the new instance
of ISOLatin1AccentFilter  but I can' t get it works properly.
Could someone help me?
thanks a lot
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message