Package org.apache.lucene.search

Examples of org.apache.lucene.search.BoostingQuery


        }
        if (negativeBoost == -1) {
            throw new QueryParsingException(parseContext.index(), "[boosting] query requires 'negative_boost' to be set'");
        }

        BoostingQuery boostingQuery = new BoostingQuery(positiveQuery, negativeQuery, negativeBoost);
        if (boost != -1) {
            boostingQuery.setBoost(boost);
        }
        return boostingQuery;
    }
View Full Code Here


    {
      throw new ParserException("BoostingQuery \"BoostQuery\" element missing a child element");
    }
    Query boostQuery=factory.getQuery(boostQueryElem);
   
    BoostingQuery bq = new BoostingQuery(mainQuery,boostQuery,boost);
    bq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
    return bq;

  }
View Full Code Here

     Element boostQueryElem=DOMUtils.getChildByTagOrFail(e,"BoostQuery");
      float boost=DOMUtils.getAttribute(boostQueryElem,"boost",defaultBoost);
     boostQueryElem=DOMUtils.getFirstChildOrFail(boostQueryElem);
      Query boostQuery=factory.getQuery(boostQueryElem);
     
      BoostingQuery bq = new BoostingQuery(mainQuery,boostQuery,boost);

      bq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
    return bq;

  }
View Full Code Here

     Element boostQueryElem=DOMUtils.getChildByTagOrFail(e,"BoostQuery");
      float boost=DOMUtils.getAttribute(boostQueryElem,"boost",defaultBoost);
     boostQueryElem=DOMUtils.getFirstChildOrFail(boostQueryElem);
      Query boostQuery=factory.getQuery(boostQueryElem);
     
      BoostingQuery bq = new BoostingQuery(mainQuery,boostQuery,boost);

      bq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
    return bq;

  }
View Full Code Here

     Element boostQueryElem=DOMUtils.getChildByTagOrFail(e,"BoostQuery");
      float boost=DOMUtils.getAttribute(boostQueryElem,"boost",defaultBoost);
     boostQueryElem=DOMUtils.getFirstChildOrFail(boostQueryElem);
      Query boostQuery=factory.getQuery(boostQueryElem);
     
      BoostingQuery bq = new BoostingQuery(mainQuery,boostQuery,boost);

      bq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
    return bq;

  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.BoostingQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.