lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romi <romijain3...@gmail.com>
Subject FieldComparatorSource
Date Mon, 13 Dec 2010 10:47:34 GMT

Hi,
   I am upgrading my project from Lucene2.4 to Lucene3.0.2.
I used FieldComparatorSource in place of SortComparatorSource and
FieldComparator in place of ScoreDocComparator. My problem is:

1. I need to implement abstract class FieldComparatorSource's method
newComparator() that is different from Lucene2.4(SortComparatorSource ).
Would u please give me some example how to use it.

The previous that was used in my project is :

   public ScoreDocComparator newComparator(IndexReader reader,
                                            String fieldname)
            throws IOException {
        NameFactory factory = NameFactoryImpl.getInstance();
        try {
            return new Comparator(reader,
                    nsMappings.translateName(factory.create(fieldname)));
        } catch (IllegalNameException e) {
            throw Util.createIOException(e);
        }
    }


-----
Romi
-- 
View this message in context: http://lucene.472066.n3.nabble.com/FieldComparatorSource-tp2077934p2077934.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message