lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Query syntax improvement: Add one boundary range query syntax
Date Mon, 03 Nov 2008 18:32:37 GMT

: Currently, lucene query syntax supports range query like foo:[a TO b]. I
: didn't find a way to support one boundary range. (Or did I miss something?)

FWIW: the SolrQueryParser (which subclasses the Lucene QueryParser) 
accomplishes this by treating '*' as special values.  

users that want similar behavior with Lucene should be able to get it 
fairly trivially with something like...

 QueryParser qp = new QueryParser("foo", analyzer) {
   protected Query newRangeQuery(String f, String a, String b, boolean i) {
     return super.newRangeQuery(f, "*".equals(a) ? null : a,
                                   "*".equals(b) ? null : b, i);
   }
 }


but commiting a chacne like that to the existing Lucene QueryParser might 
break things for some people (although it seems unlikely)



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message