diff src/goodjava/queryparser/StringFieldParser.java @ 1445:f6075d7a36f2

better range query
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 05 Feb 2020 18:06:26 -0700
parents 27efb1fcbcb5
children
line wrap: on
line diff
--- a/src/goodjava/queryparser/StringFieldParser.java	Wed Feb 05 08:16:15 2020 -0700
+++ b/src/goodjava/queryparser/StringFieldParser.java	Wed Feb 05 18:06:26 2020 -0700
@@ -55,8 +55,8 @@
 	}
 
 	@Override public Query getRangeQuery(SaneQueryParser qp,String field,String minQuery,String maxQuery,boolean includeMin,boolean includeMax) throws ParseException {
-		minQuery = escape(qp,minQuery);
-		maxQuery = escape(qp,maxQuery);
+		minQuery = minQuery.equals("*") ? null : escape(qp,minQuery);
+		maxQuery = maxQuery.equals("*") ? null : escape(qp,maxQuery);
 		return TermRangeQuery.newStringRange(field,minQuery,maxQuery,includeMin,includeMax);
 	}