Examples of BoostAttribute


Examples of org.apache.lucene.queryParser.standard.config.BoostAttribute

      if (config != null) {
        FieldConfig fieldConfig = config.getFieldConfig(fieldNode.getField());

        if (fieldConfig != null && fieldConfig.hasAttribute(BoostAttribute.class)) {
          BoostAttribute boostAttr = fieldConfig.getAttribute(BoostAttribute.class);

          return new BoostQueryNode(node, boostAttr.getBoost());

        }

      }
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.config.BoostAttribute

    };
    rangeCollatorAttr.setDateResolution(collator);
    Assert.assertTrue(collator == rangeCollatorAttr.getRangeCollator());
    Assert.assertTrue(collator == config.get(ConfigurationKeys.RANGE_COLLATOR));

    BoostAttribute boostAttr = config.addAttribute(BoostAttribute.class);

    Assert.assertEquals(1.0f, boostAttr.getBoost());
    Assert.assertEquals(1.0f, config.get(ConfigurationKeys.BOOST).floatValue());
    float boost = 2.0f;
    boostAttr.setBoost(boost);
    Assert.assertEquals(boost, boostAttr.getBoost());
    Assert
        .assertEquals(boost, config.get(ConfigurationKeys.BOOST).floatValue());

    FuzzyAttribute fuzzyAttributeAttr = config
        .addAttribute(FuzzyAttribute.class);
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.config.BoostAttribute

      if (config != null) {
        CharSequence field = fieldNode.getField();
        FieldConfig fieldConfig = config.getFieldConfig(StringUtils.toString(field));

        if (fieldConfig != null && fieldConfig.hasAttribute(BoostAttribute.class)) {
          BoostAttribute boostAttr = fieldConfig.getAttribute(BoostAttribute.class);

          return new BoostQueryNode(node, boostAttr.getBoost());

        }

      }
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.config.BoostAttribute

      if (config != null) {
        FieldConfig fieldConfig = config.getFieldConfig(fieldNode.getField());

        if (fieldConfig != null && fieldConfig.hasAttribute(BoostAttribute.class)) {
          BoostAttribute boostAttr = (BoostAttribute) fieldConfig.getAttribute(BoostAttribute.class);

          return new BoostQueryNode(node, boostAttr.getBoost());

        }

      }
View Full Code Here

Examples of org.apache.lucene.search.BoostAttribute

    final PriorityQueue<ScoreTerm> stQueue = new PriorityQueue<ScoreTerm>();
   
    BytesRef queryTerm = new BytesRef(term.text());
    BytesRef candidateTerm;
    ScoreTerm st = new ScoreTerm();
    BoostAttribute boostAtt =
      e.attributes().addAttribute(BoostAttribute.class);
    while ((candidateTerm = e.next()) != null) {
      final float boost = boostAtt.getBoost();
      // ignore uncompetitive hits
      if (stQueue.size() >= numSug && boost <= stQueue.peek().boost)
        continue;
     
      // ignore exact match of the same term
View Full Code Here

Examples of org.apache.lucene.search.BoostAttribute

    final PriorityQueue<ScoreTerm> stQueue = new PriorityQueue<ScoreTerm>();
   
    BytesRef queryTerm = new BytesRef(term.text());
    BytesRef candidateTerm;
    ScoreTerm st = new ScoreTerm();
    BoostAttribute boostAtt =
      e.attributes().addAttribute(BoostAttribute.class);
    while ((candidateTerm = e.next()) != null) {
      final float boost = boostAtt.getBoost();
      // ignore uncompetitive hits
      if (stQueue.size() >= numSug && boost <= stQueue.peek().boost)
        continue;
     
      // ignore exact match of the same term
View Full Code Here

Examples of org.apache.lucene.search.BoostAttribute

    final PriorityQueue<ScoreTerm> stQueue = new PriorityQueue<>();
   
    BytesRef queryTerm = new BytesRef(term.text());
    BytesRef candidateTerm;
    ScoreTerm st = new ScoreTerm();
    BoostAttribute boostAtt =
      e.attributes().addAttribute(BoostAttribute.class);
    while ((candidateTerm = e.next()) != null) {
      final float boost = boostAtt.getBoost();
      // ignore uncompetitive hits
      if (stQueue.size() >= numSug && boost <= stQueue.peek().boost)
        continue;
     
      // ignore exact match of the same term
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.