Example usage for org.apache.lucene.util BytesRefIterator EMPTY

List of usage examples for org.apache.lucene.util BytesRefIterator EMPTY

Introduction

In this page you can find the example usage for org.apache.lucene.util BytesRefIterator EMPTY.

Prototype

BytesRefIterator EMPTY

To view the source code for org.apache.lucene.util BytesRefIterator EMPTY.

Click Source Link

Document

Singleton BytesRefIterator that iterates over 0 BytesRefs.

Usage

From source file:com.semantic.util.suggest.MultiFieldContentLuceneDirectory.java

@Override
public InputIterator getEntryIterator() throws IOException {
    BytesRefIterator[] array = new BytesRefIterator[fields.length];
    for (int i = 0; i < array.length; i++) {
        Terms terms = MultiFields.getTerms(reader, fields[i]);
        if (terms != null) {
            array[i] = terms.iterator();
        } else {//from ww w .  j  ava2 s  . c o  m
            array[i] = BytesRefIterator.EMPTY;
        }
    }
    return new FieldValueBytesRefIterator(array);
}

From source file:com.semantic.util.suggest.MultiFieldTermLuceneDirectory.java

@Override
public InputIterator getEntryIterator() throws IOException {
    BytesRefIterator[] array = new BytesRefIterator[fields.length];
    for (int i = 0; i < array.length; i++) {
        Terms terms = MultiFields.getTerms(reader, fields[i]);
        if (terms != null) {
            array[i] = terms.iterator();
        } else {//from   w  ww.  jav  a 2s .c om
            array[i] = BytesRefIterator.EMPTY;
        }
    }
    return new CombinedBytesRefIterator(array);
}