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

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


  /**
   * Gets implicit operator setting, which will be either {@link Operator#AND}
   * or {@link Operator#OR}.
   */
  public Operator getDefaultOperator() {
    DefaultOperatorAttribute attr = getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
    return attr.getOperator();
  }
View Full Code Here


   * <code>capital OR of OR Hungary</code>.<br/>
   * In {@link Operator#AND} mode terms are considered to be in conjunction: the
   * above mentioned query is parsed as <code>capital AND of AND Hungary</code>
   */
  public void setDefaultOperator(Operator operator) {
    DefaultOperatorAttribute attr = getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
    attr.setOperator(operator);
  }
View Full Code Here

    Assert.assertEquals(minSim, config.get(ConfigurationKeys.FUZZY_CONFIG)
        .getMinSimilarity());
    Assert.assertEquals(prefixLength, config
        .get(ConfigurationKeys.FUZZY_CONFIG).getPrefixLength());

    DefaultOperatorAttribute defaultOpAttr = config
        .addAttribute(DefaultOperatorAttribute.class);

    Assert.assertEquals(DefaultOperatorAttribute.Operator.OR, defaultOpAttr
        .getOperator());
    Assert.assertEquals(Operator.OR, config
        .get(ConfigurationKeys.DEFAULT_OPERATOR));
    DefaultOperatorAttribute.Operator oldOperator = DefaultOperatorAttribute.Operator.AND;
    Operator newOperator = Operator.AND;
    defaultOpAttr.setOperator(oldOperator);
    Assert.assertEquals(oldOperator, defaultOpAttr.getOperator());
    Assert.assertEquals(newOperator, config
        .get(ConfigurationKeys.DEFAULT_OPERATOR));

  }
View Full Code Here

   *
   * @deprecated
   */
  @Deprecated
  public void setDefaultOperator(DefaultOperatorAttribute.Operator operator) {
    DefaultOperatorAttribute attr = getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
    attr.setOperator(operator);
  }
View Full Code Here

  /**
   * Gets implicit operator setting, which will be either {@link Operator#AND}
   * or {@link Operator#OR}.
   */
  public Operator getDefaultOperator() {
    DefaultOperatorAttribute attr = getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
    return attr.getOperator();
  }
View Full Code Here

   * <code>capital OR of OR Hungary</code>.<br/>
   * In {@link Operator#AND} mode terms are considered to be in conjunction: the
   * above mentioned query is parsed as <code>capital AND of AND Hungary</code>
   */
  public void setDefaultOperator(Operator operator) {
    DefaultOperatorAttribute attr = getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
    attr.setOperator(operator);
  }
View Full Code Here

  /**
   * Gets implicit operator setting, which will be either {@link Operator#AND}
   * or {@link Operator#OR}.
   */
  public Operator getDefaultOperator() {
    DefaultOperatorAttribute attr = (DefaultOperatorAttribute) getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
    return attr.getOperator();
  }
View Full Code Here

   * <code>capital OR of OR Hungary</code>.<br/>
   * In {@link Operator#AND} mode terms are considered to be in conjunction: the
   * above mentioned query is parsed as <code>capital AND of AND Hungary</code>
   */
  public void setDefaultOperator(Operator operator) {
    DefaultOperatorAttribute attr = (DefaultOperatorAttribute) getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
    attr.setOperator(operator);
  }
View Full Code Here

TOP

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

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.