lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: MultiTermQuery
Date Mon, 20 Dec 2010 10:12:32 GMT
The term is no longer a property of MTQ. You have to add it as a normal
field and handle it yourself and call default ctor. MTQ did never needed
that term and there are many MTQ subclasses in Lucene that don't have it and
it's null. Because of that it was deprecated and removed.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Romi [mailto:romijain3186@gmail.com]
> Sent: Monday, December 20, 2010 11:04 AM
> To: general@lucene.apache.org
> Subject: MultiTermQuery
> 
> 
> 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