mirror of https://github.com/apache/lucene.git
pass qparser in getRangeQuery
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@752850 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6c1bc2ef5f
commit
93587d8e9c
|
@ -435,17 +435,17 @@ public abstract class FieldType extends FieldProperties {
|
|||
* Sub-classes should override this method to provide their own range query implementation. They should strive to
|
||||
* handle nulls in part1 and/or part2 as well as unequal minInclusive and maxInclusive parameters gracefully.
|
||||
*
|
||||
* @param field the name of the field
|
||||
* @param parser
|
||||
*@param field the name of the field
|
||||
* @param part1 the lower boundary of the range, nulls are allowed.
|
||||
* @param part2 the upper boundary of the range, nulls are allowed
|
||||
* @param minInclusive whether the minimum of the range is inclusive or not
|
||||
* @param maxInclusive whether the maximum of the range is inclusive or not
|
||||
*
|
||||
* @return a Query instance to perform range search according to given parameters
|
||||
* @return a Query instance to perform range search according to given parameters
|
||||
*
|
||||
* @see org.apache.solr.search.SolrQueryParser#getRangeQuery(String, String, String, boolean)
|
||||
*/
|
||||
public Query getRangeQuery(String field, String part1, String part2, boolean minInclusive, boolean maxInclusive) {
|
||||
public Query getRangeQuery(QParser parser, String field, String part1, String part2, boolean minInclusive, boolean maxInclusive) {
|
||||
RangeQuery rangeQuery = new RangeQuery(
|
||||
field,
|
||||
part1 == null ? null : toInternal(part1),
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.apache.solr.analysis.*;
|
|||
import org.apache.solr.common.SolrException;
|
||||
import org.apache.solr.request.TextResponseWriter;
|
||||
import org.apache.solr.request.XMLWriter;
|
||||
import org.apache.solr.search.QParser;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
@ -148,7 +149,7 @@ public class TrieField extends FieldType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Query getRangeQuery(String field, String min, String max, boolean minInclusive, boolean maxInclusive) {
|
||||
public Query getRangeQuery(QParser parser, String field, String min, String max, boolean minInclusive, boolean maxInclusive) {
|
||||
Filter filter = null;
|
||||
switch (type) {
|
||||
case INTEGER:
|
||||
|
|
|
@ -119,7 +119,7 @@ public class SolrQueryParser extends QueryParser {
|
|||
protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
|
||||
checkNullField(field);
|
||||
FieldType ft = schema.getFieldType(field);
|
||||
return ft.getRangeQuery(field,
|
||||
return ft.getRangeQuery(parser, field,
|
||||
"*".equals(part1) ? null : part1,
|
||||
"*".equals(part2) ? null : part2,
|
||||
inclusive, inclusive);
|
||||
|
|
Loading…
Reference in New Issue