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

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


  /**
   * Set the minimum similarity for fuzzy queries. Default is defined on
   * {@link FuzzyQuery#defaultMinSimilarity}.
   */
  public void setFuzzyMinSim(float fuzzyMinSim) {
    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
    attr.setFuzzyMinSimilarity(fuzzyMinSim);
  }
View Full Code Here


    if (node instanceof FuzzyQueryNode) {
      FuzzyQueryNode fuzzyNode = (FuzzyQueryNode) node;
      QueryConfigHandler config = getQueryConfigHandler();

      if (config != null && config.hasAttribute(FuzzyAttribute.class)) {
        FuzzyAttribute fuzzyAttr = config.getAttribute(FuzzyAttribute.class);
        fuzzyNode.setPrefixLength(fuzzyAttr.getPrefixLength());

        if (fuzzyNode.getSimilarity() < 0) {
          fuzzyNode.setSimilarity(fuzzyAttr.getFuzzyMinSimilarity());

        }

      } else if (fuzzyNode.getSimilarity() < 0) {
        throw new IllegalArgumentException("No "
View Full Code Here

    if (node instanceof FuzzyQueryNode) {
      FuzzyQueryNode fuzzyNode = (FuzzyQueryNode) node;
      QueryConfigHandler config = getQueryConfigHandler();

      if (config != null && config.hasAttribute(FuzzyAttribute.class)) {
        FuzzyAttribute fuzzyAttr = (FuzzyAttribute) config
            .getAttribute(FuzzyAttribute.class);
        fuzzyNode.setPrefixLength(fuzzyAttr.getPrefixLength());

        if (fuzzyNode.getSimilarity() < 0) {
          fuzzyNode.setSimilarity(fuzzyAttr.getFuzzyMinSimilarity());

        }

      } else if (fuzzyNode.getSimilarity() < 0) {
        throw new IllegalArgumentException("No "
View Full Code Here

   *
   * @param fuzzyPrefixLength
   *          The fuzzyPrefixLength to set.
   */
  public void setFuzzyPrefixLength(int fuzzyPrefixLength) {
    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
    attr.setPrefixLength(fuzzyPrefixLength);
  }
View Full Code Here

  /**
   * Get the minimal similarity for fuzzy queries.
   */
  public float getFuzzyMinSim() {
    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
    return attr.getFuzzyMinSimilarity();
  }
View Full Code Here

   * Get the prefix length for fuzzy queries.
   *
   * @return Returns the fuzzyPrefixLength.
   */
  public int getFuzzyPrefixLength() {
    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
    return attr.getPrefixLength();
  }
View Full Code Here

  /**
   * Set the minimum similarity for fuzzy queries. Default is defined on
   * {@link FuzzyQuery#defaultMinSimilarity}.
   */
  public void setFuzzyMinSim(float fuzzyMinSim) {
    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
    attr.setFuzzyMinSimilarity(fuzzyMinSim);
  }
View Full Code Here

TOP

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

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.