FileDocCategorySizeDatePackage
SrndQuery.javaAPI DocApache Lucene 1.92565Mon Feb 20 09:17:42 GMT 2006org.apache.lucene.queryParser.surround.query

SrndQuery

public abstract class SrndQuery extends Object implements Cloneable
Copyright 2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Fields Summary
private float
weight
private boolean
weighted
public static final Query
theEmptyLcnQuery
Constructors Summary
public SrndQuery()

Methods Summary
public java.lang.Objectclone()

    try {
      return super.clone();
    } catch (CloneNotSupportedException cns) {
      throw new Error(cns);
    }
  
public floatgetWeight()

 return weight; 
public java.lang.StringgetWeightOperator()

return "^";
public java.lang.StringgetWeightString()

return Float.toString(getWeight());
public booleanisFieldsSubQueryAcceptable()

return true;
public booleanisWeighted()

return weighted;
public org.apache.lucene.search.QuerymakeLuceneQueryField(java.lang.String fieldName, BasicQueryFactory qf)

    Query q = makeLuceneQueryFieldNoBoost(fieldName, qf);
    if (isWeighted()) {
      q.setBoost(getWeight() * q.getBoost()); /* weight may be at any level in a SrndQuery */
    }
    return q;
  
public abstract org.apache.lucene.search.QuerymakeLuceneQueryFieldNoBoost(java.lang.String fieldName, BasicQueryFactory qf)

public voidsetWeight(float w)


      
    weight = w; /* as parsed from the query text */
    weighted = true;
  
public abstract java.lang.StringtoString()

protected voidweightToString(java.lang.StringBuffer r)

 /* append the weight part of a query */
    if (isWeighted()) {
      r.append(getWeightOperator());
      r.append(getWeightString());
    }