Example usage for org.apache.lucene.index Fields EMPTY_ARRAY

List of usage examples for org.apache.lucene.index Fields EMPTY_ARRAY

Introduction

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

Prototype

Fields[] EMPTY_ARRAY

To view the source code for org.apache.lucene.index Fields EMPTY_ARRAY.

Click Source Link

Document

Zero-length Fields array.

Usage

From source file:org.elasticsearch.index.query.MoreLikeThisQueryBuilder.java

License:Apache License

private static Fields[] getFieldsFor(MultiTermVectorsResponse responses) throws IOException {
    List<Fields> likeFields = new ArrayList<>();

    for (MultiTermVectorsItemResponse response : responses) {
        if (response.isFailed()) {
            continue;
        }/*from  w  w w .  j a  v a 2s .c  o m*/
        TermVectorsResponse getResponse = response.getResponse();
        if (!getResponse.isExists()) {
            continue;
        }
        likeFields.add(getResponse.getFields());
    }
    return likeFields.toArray(Fields.EMPTY_ARRAY);
}

From source file:org.elasticsearch.index.search.morelikethis.MoreLikeThisFetchService.java

License:Apache License

public static Fields[] getFieldsFor(MultiTermVectorsResponse responses) throws IOException {
    List<Fields> likeFields = new ArrayList<>();

    for (MultiTermVectorsItemResponse response : responses) {
        if (response.isFailed()) {
            continue;
        }// ww w  .j  a  v  a2  s  .  c om
        TermVectorsResponse getResponse = response.getResponse();
        if (!getResponse.isExists()) {
            continue;
        }
        likeFields.add(getResponse.getFields());
    }
    return likeFields.toArray(Fields.EMPTY_ARRAY);
}