Package org.apache.lucene.sandbox.queries

Examples of org.apache.lucene.sandbox.queries.FuzzyLikeThisQuery.addTerms()


      float minSimilarity = DOMUtils.getAttribute(fieldElem, "minSimilarity", DEFAULT_MIN_SIMILARITY);
      int prefixLength = DOMUtils.getAttribute(fieldElem, "prefixLength", DEFAULT_PREFIX_LENGTH);
      String fieldName = DOMUtils.getAttributeWithInheritance(fieldElem, "fieldName");

      String value = DOMUtils.getText(fieldElem);
      fbq.addTerms(value, fieldName, minSimilarity, prefixLength);
    }

    fbq.setBoost(DOMUtils.getAttribute(e, "boost", 1.0f));
    return fbq;
  }
View Full Code Here


                return null;
            }
        }

        FuzzyLikeThisQuery fuzzyLikeThisQuery = new FuzzyLikeThisQuery(maxNumTerms, analyzer);
        fuzzyLikeThisQuery.addTerms(likeText, fieldName, fuzziness.asSimilarity(), prefixLength);
        fuzzyLikeThisQuery.setBoost(boost);
        fuzzyLikeThisQuery.setIgnoreTF(ignoreTF);

        // move to the next end object, to close the field name
        token = parser.nextToken();
View Full Code Here

        }
        if (minSimilarity < 0.0f)  {
            throw new ElasticsearchIllegalArgumentException("minimumSimilarity cannot be less than 0");
        }
        for (String field : fields) {
            query.addTerms(likeText, field, minSimilarity, prefixLength);
        }
        query.setBoost(boost);
        query.setIgnoreTF(ignoreTF);

        if (queryName != null) {
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.