Example usage for org.apache.solr.common.luke FieldFlag DOC_VALUES

List of usage examples for org.apache.solr.common.luke FieldFlag DOC_VALUES

Introduction

In this page you can find the example usage for org.apache.solr.common.luke FieldFlag DOC_VALUES.

Prototype

FieldFlag DOC_VALUES

To view the source code for org.apache.solr.common.luke FieldFlag DOC_VALUES.

Click Source Link

Usage

From source file:com.github.fengtan.sophie.beans.SolrUtils.java

License:Open Source License

/**
 * Whether Solr can sort a field./*from  www.  j av a 2 s  .c om*/
 * 
 * @param field
 *            Field.
 * @return True if Solr can sort the field, false otherwise.
 */
public static boolean isFieldSortable(FieldInfo field) {
    // A field is sortable if
    // 1) it is indexed
    // 2) it is not multivalued
    // 3) it does not have docValues
    EnumSet<FieldFlag> flags = SolrUtils.getFlags(field);
    return (flags.contains(FieldFlag.INDEXED) && !flags.contains(FieldFlag.DOC_VALUES)
            && !flags.contains(FieldFlag.MULTI_VALUED));
}