Package org.apache.lucene.queryParser.standard.config

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


    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
    attr.setFuzzyMinSimilarity(fuzzyMinSim);
  }
 
  public void setFieldsBoost(Map<CharSequence, Float> boosts) {
    FieldBoostMapAttribute attr = getQueryConfigHandler().addAttribute(FieldBoostMapAttribute.class);
    attr.setFieldBoostMap(boosts);
  }
View Full Code Here


    Assert.assertEquals(phraseSlop, defaultPhraseSlopAttr
        .getDefaultPhraseSlop());
    Assert.assertEquals(phraseSlop, config.get(ConfigurationKeys.PHRASE_SLOP)
        .intValue());

    FieldBoostMapAttribute fieldBoostMapAttr = config
        .addAttribute(FieldBoostMapAttribute.class);

    Assert.assertEquals(new LinkedHashMap<String, Float>(), fieldBoostMapAttr
        .getFieldBoostMap());
    Assert.assertEquals(new LinkedHashMap<String, Float>(), config
        .get(ConfigurationKeys.FIELD_BOOST_MAP));
    LinkedHashMap<String, Float> fieldBoostMap = new LinkedHashMap<String, Float>();
    fieldBoostMap.put("test", 0.3f);
    fieldBoostMapAttr.setFieldBoostMap(fieldBoostMap);
    Assert.assertEquals(fieldBoostMap, fieldBoostMapAttr.getFieldBoostMap());
    Assert.assertEquals(fieldBoostMap, config
        .get(ConfigurationKeys.FIELD_BOOST_MAP));

    FieldDateResolutionMapAttribute fieldDateResolutionMapAttr = config
        .addAttribute(FieldDateResolutionMapAttribute.class);
View Full Code Here

   * Sets the boost used for each field.
   *
   * @param boosts a collection that maps a field to its boost
   */
  public void setFieldsBoost(Map<String, Float> boosts) {
    FieldBoostMapAttribute attr = getQueryConfigHandler().addAttribute(
        FieldBoostMapAttribute.class);
    attr.setFieldBoostMap(boosts);
    // uncomment code below when deprecated query parser attributes are removed
    // getQueryConfigHandler().set(ConfigurationKeys.FIELD_BOOST_MAP, boosts);
  }
View Full Code Here

    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
    attr.setFuzzyMinSimilarity(fuzzyMinSim);
  }
 
  public void setFieldsBoost(Map<String, Float> boosts) {
    FieldBoostMapAttribute attr = getQueryConfigHandler().addAttribute(FieldBoostMapAttribute.class);
    attr.setFieldBoostMap(boosts);
  }
View Full Code Here

    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
    attr.setFuzzyMinSimilarity(fuzzyMinSim);
  }
 
  public void setFieldsBoost(Map<CharSequence, Float> boosts) {
    FieldBoostMapAttribute attr = (FieldBoostMapAttribute) getQueryConfigHandler().addAttribute(FieldBoostMapAttribute.class);
    attr.setFieldBoostMap(boosts);
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.queryParser.standard.config.FieldBoostMapAttribute

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.