: +++ lucene/solr/trunk/src/java/org/apache/solr/schema/FieldType.java Wed Mar
11 19:50:04 2009
: + public Query getRangeQuery(String field, String part1, String part2,
boolean inclusive) {
: + RangeQuery rangeQuery = new RangeQuery(
: + field,
: + "*".equals(part1) ? null : toInternal(part1),
: + "*".equals(part2) ? null : toInternal(part2),
: + inclusive, inclusive);
: + rangeQuery.setConstantScoreRewrite(true);
: + return rangeQuery;
I don't think treating "*" as special is something FieldType (or
TrieField) should do -- that's specific to the syntax of the QueryParser.
The FieldType classes should treat the string as a string. (otherwise if i
write a new QueryParser where * isn't a special character and use some
syntax like "phoneNumber < *69" i'm screwed.
"*69" as the
I also think having a single "inclusive" boolean is a bad idea.
I would javadoc that the lower/upper bounds can be null, and have
SolrQueryParser pass null when it sees "*" in the syntax. we should also
be explicit in the javadocs about what combinations of inclusion booleans
and null values are allowed so that subclasses know what to expect
(i remember there was some confusion about this when RangeFilter was
introduced in Lucene - different people have different assumptions about
wether you can have a range that includes an un-specified boundary)
-Hoss