Example usage for org.apache.solr.schema FieldType getRangeQuery

List of usage examples for org.apache.solr.schema FieldType getRangeQuery

Introduction

In this page you can find the example usage for org.apache.solr.schema FieldType getRangeQuery.

Prototype

public Query getRangeQuery(QParser parser, SchemaField field, String part1, String part2, boolean minInclusive,
        boolean maxInclusive) 

Source Link

Document

Returns a Query instance for doing range searches on this field type.

Usage

From source file:org.jahia.services.search.facets.SimpleJahiaJcrFacets.java

License:Open Source License

private Query getRangeQuery(FieldType fieldType, QParser parser, SchemaField schemaField, String prefix,
        String low, String high, boolean minInclusive, boolean maxInclusive) {
    return prefixRangeQuery(fieldType.getRangeQuery(parser, schemaField, low, high, minInclusive, maxInclusive),
            prefix);//w w w.  j  a  v a 2 s .c o  m
}

From source file:org.tallison.solr.search.SolrSpanQueryParser.java

License:Apache License

@Override
public Query newRangeQuery(String fieldName, String start, String end, boolean startInclusive,
        boolean endInclusive) {
    //lifted from SolrQueryParserBase
    SchemaField sf = schema.getFieldOrNull(fieldName);
    if (sf != null) {
        FieldType ft = sf.getType();
        if (ft instanceof TextField) {
            return super.newRangeQuery(fieldName, start, end, startInclusive, endInclusive);
        }/*from  w w  w  . j  a va 2s  .c  o m*/
        return ft.getRangeQuery(nonTextParser, sf, start, end, startInclusive, endInclusive);
    }
    throw new IllegalArgumentException("Can't create range query on null field: " + fieldName);
}