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

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


  /**
   * Sets the default slop for phrases. If zero, then exact phrase matches are
   * required. Default value is zero.
   */
  public void setDefaultPhraseSlop(int defaultPhraseSlop) {
    DefaultPhraseSlopAttribute attr = getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
    attr.setDefaultPhraseSlop(defaultPhraseSlop);
  }
View Full Code Here


  /**
   * Gets the default slop for phrases.
   */
  public int getPhraseSlop() {
    DefaultPhraseSlopAttribute attr = getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
    return attr.getDefaultPhraseSlop();
  }
View Full Code Here

    DateTools.Resolution dateRes = DateTools.Resolution.HOUR;
    dateResAttr.setDateResolution(dateRes);
    Assert.assertTrue(dateRes == dateResAttr.getDateResolution());
    Assert.assertTrue(dateRes == config.get(ConfigurationKeys.DATE_RESOLUTION));

    DefaultPhraseSlopAttribute defaultPhraseSlopAttr = config
        .addAttribute(DefaultPhraseSlopAttribute.class);

    Assert.assertEquals(0, defaultPhraseSlopAttr.getDefaultPhraseSlop());
    Assert
        .assertEquals(0, config.get(ConfigurationKeys.PHRASE_SLOP).intValue());
    int phraseSlop = 1;
    defaultPhraseSlopAttr.setDefaultPhraseSlop(phraseSlop);
    Assert.assertEquals(phraseSlop, defaultPhraseSlopAttr
        .getDefaultPhraseSlop());
    Assert.assertEquals(phraseSlop, config.get(ConfigurationKeys.PHRASE_SLOP)
        .intValue());

    FieldBoostMapAttribute fieldBoostMapAttr = config
View Full Code Here

  /**
   * Sets the default slop for phrases. If zero, then exact phrase matches are
   * required. Default value is zero.
   */
  public void setPhraseSlop(int defaultPhraseSlop) {
    DefaultPhraseSlopAttribute attr = getQueryConfigHandler().addAttribute(
        DefaultPhraseSlopAttribute.class);
    attr.setDefaultPhraseSlop(defaultPhraseSlop);
    // uncomment code below when deprecated query parser attributes are removed
    // getQueryConfigHandler().set(ConfigurationKeys.PHRASE_SLOP,
    // defaultPhraseSlop);
  }
View Full Code Here

  /**
   * Sets the default slop for phrases. If zero, then exact phrase matches are
   * required. Default value is zero.
   */
  public void setDefaultPhraseSlop(int defaultPhraseSlop) {
    DefaultPhraseSlopAttribute attr = getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
    attr.setDefaultPhraseSlop(defaultPhraseSlop);
  }
View Full Code Here

  /**
   * Gets the default slop for phrases.
   */
  public int getPhraseSlop() {
    DefaultPhraseSlopAttribute attr = getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
    return attr.getDefaultPhraseSlop();
  }
View Full Code Here

  /**
   * Sets the default slop for phrases. If zero, then exact phrase matches are
   * required. Default value is zero.
   */
  public void setDefaultPhraseSlop(int defaultPhraseSlop) {
    DefaultPhraseSlopAttribute attr = (DefaultPhraseSlopAttribute) getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
    attr.setDefaultPhraseSlop(defaultPhraseSlop);
  }
View Full Code Here

  /**
   * Gets the default slop for phrases.
   */
  public int getPhraseSlop() {
    DefaultPhraseSlopAttribute attr = (DefaultPhraseSlopAttribute) getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
    return attr.getDefaultPhraseSlop();
  }
View Full Code Here

TOP

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

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.