Example usage for org.apache.lucene.queries.function.valuesource MultiValuedIntFieldSource MultiValuedIntFieldSource

List of usage examples for org.apache.lucene.queries.function.valuesource MultiValuedIntFieldSource MultiValuedIntFieldSource

Introduction

In this page you can find the example usage for org.apache.lucene.queries.function.valuesource MultiValuedIntFieldSource MultiValuedIntFieldSource.

Prototype

public MultiValuedIntFieldSource(String field, Type selector) 

Source Link

Usage

From source file:org.apache.solr.schema.EnumFieldType.java

License:Apache License

@Override
public final ValueSource getSingleValueSource(MultiValueSelector choice, SchemaField field, QParser parser) {
    if (!field.multiValued()) { // trivial base case
        return getValueSource(field, parser); // single value matches any selector
    }//from   w w  w. jav a  2  s . c  o  m
    SortedNumericSelector.Type selectorType = choice.getSortedNumericSelectorType();
    if (null == selectorType) {
        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
                choice.toString() + " is not a supported option for picking a single value"
                        + " from the multivalued field: " + field.getName() + " (type: " + this.getTypeName()
                        + ")");
    }
    return new MultiValuedIntFieldSource(field.getName(), selectorType);
}