Example usage for org.apache.lucene.index SingleTermsEnum SingleTermsEnum

List of usage examples for org.apache.lucene.index SingleTermsEnum SingleTermsEnum

Introduction

In this page you can find the example usage for org.apache.lucene.index SingleTermsEnum SingleTermsEnum.

Prototype

public SingleTermsEnum(TermsEnum tenum, BytesRef termText) 

Source Link

Document

Creates a new SingleTermsEnum.

Usage

From source file:com.sindicetech.siren.search.node.NodeFuzzyQuery.java

License:Open Source License

@Override
protected TermsEnum getTermsEnum(final Terms terms, final AttributeSource atts) throws IOException {
    if (maxEdits == 0 || prefixLength >= term.text().length()) { // can only match if it's exact
        return new SingleTermsEnum(terms.iterator(null), term.bytes());
    }// w w w . j a  v a  2 s .co m
    return new FuzzyTermsEnum(terms, atts, this.getTerm(), maxEdits, prefixLength, transpositions);
}