lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romi <romijain3...@gmail.com>
Subject MultiTermQuery
Date Mon, 20 Dec 2010 10:04:06 GMT

Hi, 
  In lucene 3.0.2 implementation of MultiTermQuery has been changed.
can u please give me an example of how to make a custom MultiTermQuery.
I am pasting code(Lucene 2.4.1) that project was using previously now i have
to upgrade it in Lucene3.0.2 :
Problem I am facing is in bold letters
1. In lucene3.0.2 MultiTermQuery have default constructor so we can not use
super(Term term).
how can i resolve this problem please suggest.


/**
 * <code>CaseTermQuery</code> implements a term query which convert the term
 * from the index either to upper or lower case before it is matched.
 */
abstract class CaseTermQuery extends MultiTermQuery implements
TransformConstants {

    /**
     * Indicates whether terms from the index should be lower-cased or
     * upper-cased.
     */
    protected final int transform;

    CaseTermQuery(Term term, int transform) {
        super(term);
        this.transform = transform;
    }

    /**
     * {@inheritDoc}
     */
    protected FilteredTermEnum getEnum(IndexReader reader) throws
IOException {
        return new CaseTermEnum(reader);
    }

    static final class Upper extends CaseTermQuery {

        Upper(Term term) {
            super(term, TRANSFORM_UPPER_CASE);
        }
    }

    static final class Lower extends CaseTermQuery {

        Lower(Term term) {
            super(term, TRANSFORM_LOWER_CASE);
        }

    }

 

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

Mime
View raw message