lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r791175 [1/2] - in /lucene/java/trunk: ./ contrib/collation/src/test/org/apache/lucene/collation/ contrib/highlighter/src/java/org/apache/lucene/search/highlight/ contrib/highlighter/src/test/org/apache/lucene/search/highlight/ contrib/misc...
Date Sat, 04 Jul 2009 20:14:13 GMT
Author: uschindler
Date: Sat Jul  4 20:14:12 2009
New Revision: 791175

URL: http://svn.apache.org/viewvc?rev=791175&view=rev
Log:
LUCENE-1713: Rename RangeQuery -> TermRangeQuery (part 1)

Added:
    lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeFilter.java
      - copied, changed from r790472, lucene/java/trunk/src/java/org/apache/lucene/search/RangeFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java
      - copied, changed from r790472, lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeTermEnum.java
      - copied, changed from r790472, lucene/java/trunk/src/java/org/apache/lucene/search/RangeTermEnum.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeFilter.java
      - copied, changed from r790584, lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeQuery.java
      - copied, changed from r790584, lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java
Removed:
    lucene/java/trunk/src/java/org/apache/lucene/search/RangeFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/RangeTermEnum.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java
Modified:
    lucene/java/trunk/BUILD.txt
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/common-build.xml
    lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermExtractor.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
    lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
    lucene/java/trunk/contrib/miscellaneous/src/test/org/apache/lucene/misc/ChainedFilterTest.java
    lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java
    lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/builders/RangeFilterBuilder.java
    lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/CharStream.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/ParseException.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/Token.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/TokenMgrError.java
    lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreRangeQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
    lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/package.html
    lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java

Modified: lucene/java/trunk/BUILD.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/BUILD.txt?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/BUILD.txt (original)
+++ lucene/java/trunk/BUILD.txt Sat Jul  4 20:14:12 2009
@@ -67,7 +67,8 @@
 
 Building the Lucene distribution from the source does not require the JavaCC
 parser generator, but if you wish to regenerate any of the pre-generated
-parser pieces, you will need to install JavaCC.
+parser pieces, you will need to install JavaCC. Version 4.1 is tested to
+work correctly.
 
   http://javacc.dev.java.net
 

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Sat Jul  4 20:14:12 2009
@@ -281,6 +281,12 @@
     includes more detailed status than previously.  (Tim Smith via
     Mike McCandless)
 
+28. LUCENE-1713: Deprecated RangeQuery and RangeFilter and renamed
+    to TermRangeQuery and TermRangeFilter. TermRangeQuery is in
+    constant score rewrite mode by default. The new classes also have
+    new ctors taking field and term ranges as Strings (see also
+    LUCENE-1424).  (Uwe Schindler)
+
 Bug fixes
 
 1. LUCENE-1415: MultiPhraseQuery has incorrect hashCode() and equals()
@@ -374,7 +380,7 @@
     packaged as War file (Mark Harwood)    
 
  6. LUCENE-1424: Moved constant score query rewrite capability into
-    MultiTermQuery, allowing RangeQuery, PrefixQuery and WildcardQuery
+    MultiTermQuery, allowing TermRangeQuery, PrefixQuery and WildcardQuery
     to switch betwen constant-score rewriting or BooleanQuery
     expansion rewriting via a new setConstantScoreRewrite method.
     Deprecated ConstantScoreRangeQuery (Mark Miller via Mike

Modified: lucene/java/trunk/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/common-build.xml?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/common-build.xml (original)
+++ lucene/java/trunk/common-build.xml Sat Jul  4 20:14:12 2009
@@ -42,7 +42,7 @@
   <property name="Name" value="Lucene"/>
   <property name="dev.version" value="2.9-dev"/>
   <property name="version" value="${dev.version}"/>
-  <property name="compatibility.tag" value="lucene_2_4_back_compat_tests_20090623a"/>
+  <property name="compatibility.tag" value="lucene_2_4_back_compat_tests_20090704"/>
   <property name="spec.version" value="${version}"/>	
   <property name="year" value="2000-${current.year}"/>
   <property name="final.name" value="lucene-${name}-${version}"/>

Modified: lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java (original)
+++ lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java Sat Jul  4 20:14:12 2009
@@ -29,9 +29,9 @@
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.RangeFilter;
+import org.apache.lucene.search.TermRangeFilter;
 import org.apache.lucene.search.TermQuery;
-import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.ConstantScoreRangeQuery;
 import org.apache.lucene.search.Searcher;
 import org.apache.lucene.search.Sort;
@@ -102,7 +102,7 @@
     result = is.search(aqp.parse("[ \u0633 TO \u0638 ]"), null, 1000).scoreDocs;
     assertEquals("The index Term should be included.", 1, result.length);
 
-    // Test RangeQuery
+    // Test TermRangeQuery
     aqp.setUseOldRangeQuery(true);
     result = is.search(aqp.parse("[ \u062F TO \u0698 ]"), null, 1000).scoreDocs;
     assertEquals("The index Term should not be included.", 0, result.length);
@@ -132,15 +132,15 @@
 
     // Unicode order would include U+0633 in [ U+062F - U+0698 ], but Farsi
     // orders the U+0698 character before the U+0633 character, so the single
-    // index Term below should NOT be returned by a RangeFilter with a Farsi
+    // index Term below should NOT be returned by a TermRangeFilter with a Farsi
     // Collator (or an Arabic one for the case when Farsi searcher not
     // supported).
     ScoreDoc[] result = searcher.search
-      (query, new RangeFilter("content", firstBeg, firstEnd, true, true), 1).scoreDocs;
+      (query, new TermRangeFilter("content", firstBeg, firstEnd, true, true), 1).scoreDocs;
     assertEquals("The index Term should not be included.", 0, result.length);
 
     result = searcher.search
-      (query, new RangeFilter("content", secondBeg, secondEnd, true, true), 1).scoreDocs;
+      (query, new TermRangeFilter("content", secondBeg, secondEnd, true, true), 1).scoreDocs;
     assertEquals("The index Term should be included.", 1, result.length);
 
     searcher.close();
@@ -156,7 +156,7 @@
 
     // Unicode order would include U+0633 in [ U+062F - U+0698 ], but Farsi
     // orders the U+0698 character before the U+0633 character, so the single
-    // index Term below should NOT be returned by a RangeQuery with a Farsi
+    // index Term below should NOT be returned by a TermRangeQuery with a Farsi
     // Collator (or an Arabic one for the case when Farsi is not supported).
     doc.add(new Field("content", "\u0633\u0627\u0628", 
                       Field.Store.YES, Field.Index.ANALYZED));
@@ -164,13 +164,11 @@
     writer.close();
     IndexSearcher searcher = new IndexSearcher(ramDir);
 
-    Query query = new RangeQuery(new Term("content", firstBeg),
-                                 new Term("content", firstEnd), true);
+    Query query = new TermRangeQuery("content", firstBeg, firstEnd, true, true);
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("The index Term should not be included.", 0, hits.length);
 
-    query = new RangeQuery(new Term("content", secondBeg),
-                           new Term("content", secondEnd), true);
+    query = new TermRangeQuery("content", secondBeg, secondEnd, true, true);
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("The index Term should be included.", 1, hits.length);
     searcher.close();

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermExtractor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermExtractor.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermExtractor.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermExtractor.java Sat Jul  4 20:14:12 2009
@@ -29,7 +29,7 @@
 
 /**
  * Utility class used to extract the terms used in a query, plus any weights.
- * This class will not find terms for MultiTermQuery, RangeQuery and PrefixQuery classes
+ * This class will not find terms for MultiTermQuery, TermRangeQuery and PrefixQuery classes
  * so the caller must pass a rewritten query (see Query.rewrite) to obtain a list of 
  * expanded terms. 
  * 

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java Sat Jul  4 20:14:12 2009
@@ -45,7 +45,7 @@
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.PrefixQuery;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.WildcardQuery;
 import org.apache.lucene.search.spans.SpanNearQuery;
@@ -145,8 +145,8 @@
         query = mtq;
       }
       String field;
-      if(mtq instanceof RangeQuery) {
-        field = ((RangeQuery)mtq).getField();
+      if(mtq instanceof TermRangeQuery) {
+        field = ((TermRangeQuery)mtq).getField();
       } else {
         field = mtq.getTerm().field();
       }
@@ -472,10 +472,10 @@
   }
   
   private MultiTermQuery copyMultiTermQuery(MultiTermQuery query) {
-    if(query instanceof RangeQuery) {
-      RangeQuery q = (RangeQuery)query;
+    if(query instanceof TermRangeQuery) {
+      TermRangeQuery q = (TermRangeQuery)query;
       q.setBoost(query.getBoost());
-      return new RangeQuery(q.getField(), q.getLowerTermText(), q.getUpperTermText(), q.includesLower(), q.includesUpper());
+      return new TermRangeQuery(q.getField(), q.getLowerTerm(), q.getUpperTerm(), q.includesLower(), q.includesUpper());
     } else if(query instanceof WildcardQuery) {
       MultiTermQuery q = new WildcardQuery(query.getTerm());
       q.setBoost(query.getBoost());

Modified: lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java Sat Jul  4 20:14:12 2009
@@ -59,7 +59,7 @@
 import org.apache.lucene.search.MultiSearcher;
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.RangeFilter;
+import org.apache.lucene.search.TermRangeFilter;
 import org.apache.lucene.search.Searcher;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
@@ -484,7 +484,7 @@
         numHighlights = 0;
         String queryString = FIELD_NAME + ":[kannedy TO kznnedy]";
 
-        // Need to explicitly set the QueryParser property to use RangeQuery
+        // Need to explicitly set the QueryParser property to use TermRangeQuery
         // rather
         // than RangeFilters
         QueryParser parser = new QueryParser(FIELD_NAME, new StandardAnalyzer());
@@ -701,7 +701,7 @@
 
       public void run() throws Exception {
         numHighlights = 0;
-        RangeFilter rf = new RangeFilter("contents", "john", "john", true, true);
+        TermRangeFilter rf = new TermRangeFilter("contents", "john", "john", true, true);
         SpanQuery clauses[] = { new SpanTermQuery(new Term("contents", "john")),
             new SpanTermQuery(new Term("contents", "kennedy")), };
         SpanNearQuery snq = new SpanNearQuery(clauses, 1, true);
@@ -723,7 +723,7 @@
 
       public void run() throws Exception {
         numHighlights = 0;
-        RangeFilter rf = new RangeFilter("contents", "john", "john", true, true);
+        TermRangeFilter rf = new TermRangeFilter("contents", "john", "john", true, true);
         PhraseQuery pq = new PhraseQuery();
         pq.add(new Term("contents", "john"));
         pq.add(new Term("contents", "kennedy"));

Modified: lucene/java/trunk/contrib/miscellaneous/src/test/org/apache/lucene/misc/ChainedFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/miscellaneous/src/test/org/apache/lucene/misc/ChainedFilterTest.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/contrib/miscellaneous/src/test/org/apache/lucene/misc/ChainedFilterTest.java (original)
+++ lucene/java/trunk/contrib/miscellaneous/src/test/org/apache/lucene/misc/ChainedFilterTest.java Sat Jul  4 20:14:12 2009
@@ -40,7 +40,7 @@
   private IndexSearcher searcher;
   private Query query;
   // private DateFilter dateFilter;   DateFilter was deprecated and removed
-  private RangeFilter dateFilter;
+  private TermRangeFilter dateFilter;
   private QueryWrapperFilter bobFilter;
   private QueryWrapperFilter sueFilter;
 
@@ -76,7 +76,7 @@
     //Date pastTheEnd = parseDate("2099 Jan 1");
     // dateFilter = DateFilter.Before("date", pastTheEnd);
     // just treat dates as strings and select the whole range for now...
-    dateFilter = new RangeFilter("date","","ZZZZ",true,true);
+    dateFilter = new TermRangeFilter("date","","ZZZZ",true,true);
 
     bobFilter = new QueryWrapperFilter(
         new TermQuery(new Term("owner", "bob")));

Modified: lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java (original)
+++ lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java Sat Jul  4 20:14:12 2009
@@ -30,7 +30,7 @@
 import org.apache.lucene.search.BooleanFilter;
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.FilterClause;
-import org.apache.lucene.search.RangeFilter;
+import org.apache.lucene.search.TermRangeFilter;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.DocIdBitSet;
 
@@ -84,7 +84,7 @@
 	
   private Filter getRangeFilter(String field,String lowerPrice, String upperPrice, boolean old)
 	{
-    Filter f = new RangeFilter(field,lowerPrice,upperPrice,true,true);
+    Filter f = new TermRangeFilter(field,lowerPrice,upperPrice,true,true);
     if (old) {
       return getOldBitSetFilter(f);
     }

Modified: lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/builders/RangeFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/builders/RangeFilterBuilder.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/builders/RangeFilterBuilder.java (original)
+++ lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/builders/RangeFilterBuilder.java Sat Jul  4 20:14:12 2009
@@ -4,7 +4,7 @@
 package org.apache.lucene.xmlparser.builders;
 
 import org.apache.lucene.search.Filter;
-import org.apache.lucene.search.RangeFilter;
+import org.apache.lucene.search.TermRangeFilter;
 import org.apache.lucene.xmlparser.DOMUtils;
 import org.apache.lucene.xmlparser.FilterBuilder;
 import org.apache.lucene.xmlparser.ParserException;
@@ -39,7 +39,7 @@
 		String upperTerm=e.getAttribute("upperTerm");
 		boolean includeLower=DOMUtils.getAttribute(e,"includeLower",true);
 		boolean includeUpper=DOMUtils.getAttribute(e,"includeUpper",true);
-		return new RangeFilter(fieldName,lowerTerm,upperTerm,includeLower,includeUpper);
+		return new TermRangeFilter(fieldName,lowerTerm,upperTerm,includeLower,includeUpper);
 	}
 
 }

Modified: lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java Sat Jul  4 20:14:12 2009
@@ -18,7 +18,7 @@
  */
 
 import org.apache.lucene.search.PrefixQuery;
-import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.NumericRangeQuery; // for javadocs
 import org.apache.lucene.util.NumericUtils; // for javadocs
 
@@ -33,7 +33,7 @@
  * which makes them suitable for use as field values and search terms.
  *
  * <P>Note that this class saves dates with millisecond granularity,
- * which is bad for {@link RangeQuery} and {@link PrefixQuery}, as those
+ * which is bad for {@link TermRangeQuery} and {@link PrefixQuery}, as those
  * queries are expanded to a BooleanQuery with a potentially large number
  * of terms when searching. Thus you might want to use
  * {@link DateTools} instead.

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/CharStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/CharStream.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/CharStream.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/CharStream.java Sat Jul  4 20:14:12 2009
@@ -109,4 +109,4 @@
   void Done();
 
 }
-/* JavaCC - OriginalChecksum=a83909a2403f969f94d18375f9f143e4 (do not edit this line) */
+/* JavaCC - OriginalChecksum=32a89423891f765dde472f7ef0e3ef7b (do not edit this line) */

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/ParseException.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/ParseException.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/ParseException.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/ParseException.java Sat Jul  4 20:14:12 2009
@@ -195,4 +195,4 @@
    }
 
 }
-/* JavaCC - OriginalChecksum=c63b396885c4ff44d7aa48d3feae60cd (do not edit this line) */
+/* JavaCC - OriginalChecksum=c7631a240f7446940695eac31d9483ca (do not edit this line) */

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java Sat Jul  4 20:14:12 2009
@@ -31,7 +31,7 @@
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.PrefixQuery;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.WildcardQuery;
 import org.apache.lucene.util.Parameter;
@@ -174,7 +174,6 @@
     }
     catch (ParseException tme) {
       // rethrow to include the original query:
-      // rethrow to include the original query:
       ParseException e = new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
       e.initCause(tme);
       throw e;
@@ -877,22 +876,15 @@
   }
 
   /**
-   * Builds a new RangeQuery instance
+   * Builds a new TermRangeQuery instance
    * @param field Field
    * @param part1 min
    * @param part2 max
    * @param inclusive true if range is inclusive
-   * @return new RangeQuery instance
+   * @return new TermRangeQuery instance
    */
   protected Query newRangeQuery(String field, String part1, String part2, boolean inclusive) {
-    RangeQuery query;
-
-    if (constantScoreRewrite) {
-      // TODO: remove in Lucene 3.0
-      query = new ConstantScoreRangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
-    } else {
-      query = new RangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
-    }
+    final TermRangeQuery query = new TermRangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
     query.setConstantScoreRewrite(constantScoreRewrite);
     return query;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj Sat Jul  4 20:14:12 2009
@@ -55,7 +55,7 @@
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.PrefixQuery;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.WildcardQuery;
 import org.apache.lucene.util.Parameter;
@@ -198,13 +198,19 @@
     }
     catch (ParseException tme) {
       // rethrow to include the original query:
-      throw new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
+      ParseException e = new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
+      e.initCause(tme);
+      throw e;
     }
     catch (TokenMgrError tme) {
-      throw new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
+      ParseException e = new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
+      e.initCause(tme);
+      throw e;
     }
     catch (BooleanQuery.TooManyClauses tmc) {
-      throw new ParseException("Cannot parse '" +query+ "': too many boolean clauses");
+      ParseException e = new ParseException("Cannot parse '" +query+ "': too many boolean clauses");
+      e.initCause(tmc);
+      throw e;
     }
   }
 
@@ -894,22 +900,15 @@
   }
 
   /**
-   * Builds a new RangeQuery instance
+   * Builds a new TermRangeQuery instance
    * @param field Field
    * @param part1 min
    * @param part2 max
    * @param inclusive true if range is inclusive
-   * @return new RangeQuery instance
+   * @return new TermRangeQuery instance
    */
   protected Query newRangeQuery(String field, String part1, String part2, boolean inclusive) {
-    RangeQuery query;  
-  
-    if (constantScoreRewrite) {
-      // TODO: remove in Lucene 3.0
-      query = new ConstantScoreRangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
-    } else {
-      query = new RangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
-    }
+    final TermRangeQuery query = new TermRangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
     query.setConstantScoreRewrite(constantScoreRewrite);
     return query;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java Sat Jul  4 20:14:12 2009
@@ -29,7 +29,7 @@
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.PrefixQuery;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.WildcardQuery;
 import org.apache.lucene.util.Parameter;

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/Token.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/Token.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/Token.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/Token.java Sat Jul  4 20:14:12 2009
@@ -121,4 +121,4 @@
   }
 
 }
-/* JavaCC - OriginalChecksum=37b1923f964a5a434f5ea3d6952ff200 (do not edit this line) */
+/* JavaCC - OriginalChecksum=c147cc166a7cf8812c7c39bc8c5eb868 (do not edit this line) */

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/TokenMgrError.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/TokenMgrError.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/TokenMgrError.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/TokenMgrError.java Sat Jul  4 20:14:12 2009
@@ -137,4 +137,4 @@
       this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
    }
 }
-/* JavaCC - OriginalChecksum=55cddb2336a66b376c0bb59d916b326d (do not edit this line) */
+/* JavaCC - OriginalChecksum=186d5bcc64733844c7daab5ad5a6e349 (do not edit this line) */

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java Sat Jul  4 20:14:12 2009
@@ -34,7 +34,7 @@
 
   /** Thrown when an attempt is made to add more than {@link
    * #getMaxClauseCount()} clauses. This typically happens if
-   * a PrefixQuery, FuzzyQuery, WildcardQuery, or RangeQuery 
+   * a PrefixQuery, FuzzyQuery, WildcardQuery, or TermRangeQuery 
    * is expanded to many terms during search. 
    */
   public static class TooManyClauses extends RuntimeException {
@@ -58,8 +58,8 @@
    * so this parameter indirectly controls the maximum buffer requirements for
    * query search.
    * <p>When this parameter becomes a bottleneck for a Query one can use a
-   * Filter. For example instead of a {@link RangeQuery} one can use a
-   * {@link RangeFilter}.
+   * Filter. For example instead of a {@link TermRangeQuery} one can use a
+   * {@link TermRangeFilter}.
    * <p>Normally the buffers are allocated by the JVM. When using for example
    * {@link org.apache.lucene.store.MMapDirectory} the buffering is left to
    * the operating system.

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreRangeQuery.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreRangeQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreRangeQuery.java Sat Jul  4 20:14:12 2009
@@ -29,31 +29,32 @@
  * Either or both endpoints may be open.  Open endpoints may not be exclusive
  * (you can't select all but the first or last term without explicitly specifying the term to exclude.)
  *
- * @deprecated Please use {@link RangeQuery}, and call
- * {@link RangeQuery#setConstantScoreRewrite}, instead.
+ * @deprecated Use {@link TermRangeQuery} for term ranges or
+ * {@link NumericRangeQuery} for numeric ranges instead.
+ * This class will be removed in Lucene 3.0.
  * @version $Id$
  */
-public class ConstantScoreRangeQuery extends RangeQuery
+public class ConstantScoreRangeQuery extends TermRangeQuery
 {
 
   public ConstantScoreRangeQuery(String fieldName, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper)
   {
     super(fieldName, lowerVal, upperVal, includeLower, includeUpper);
-    this.constantScoreRewrite = true;
+    setConstantScoreRewrite(true);
   }
 
   public ConstantScoreRangeQuery(String fieldName, String lowerVal,
                                  String upperVal, boolean includeLower,
                                  boolean includeUpper, Collator collator) {
     super(fieldName, lowerVal, upperVal, includeLower, includeUpper, collator);
-    this.constantScoreRewrite = true;
+    setConstantScoreRewrite(true);
   }
 
   public String getLowerVal() {
-    return getLowerTermText();
+    return getLowerTerm();
   }
 
   public String getUpperVal() {
-    return getUpperTermText();
+    return getUpperTerm();
   }
 }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java Sat Jul  4 20:14:12 2009
@@ -31,9 +31,9 @@
  * even if the range itself changes. 
  * 
  * <p>This means that FieldCacheRangeFilter is much faster (sometimes more than 100x as fast) 
- * as building a {@link RangeFilter} (or {@link ConstantScoreRangeQuery} on a {@link RangeFilter})
+ * as building a {@link TermRangeFilter} (or {@link ConstantScoreRangeQuery} on a {@link TermRangeFilter})
  * for each query, if using a {@link #newStringRange}. However, if the range never changes it
- * is slower (around 2x as slow) than building a CachingWrapperFilter on top of a single RangeFilter.
+ * is slower (around 2x as slow) than building a CachingWrapperFilter on top of a single TermRangeFilter.
  *
  * For numeric data types, this filter may be significantly faster than {@link NumericRangeFilter}.
  * Furthermore, it does not need the numeric values encoded by {@link NumericField}. But

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java Sat Jul  4 20:14:12 2009
@@ -34,7 +34,7 @@
  * be used by itself. Normally you subclass it to provide a Filter
  * counterpart for a {@link MultiTermQuery} subclass.
  * <P>
- * For example, {@link RangeFilter} and {@link PrefixFilter} extend
+ * For example, {@link TermRangeFilter} and {@link PrefixFilter} extend
  * <code>MultiTermQueryWrapperFilter</code>.
  * This class also provides the functionality behind
  * {@link MultiTermQuery#getFilter}, this is why it is not abstract.

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Query.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Query.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Query.java Sat Jul  4 20:14:12 2009
@@ -36,7 +36,8 @@
     <li> {@link PrefixQuery}
     <li> {@link MultiPhraseQuery}
     <li> {@link FuzzyQuery}
-    <li> {@link RangeQuery}
+    <li> {@link TermRangeQuery}
+    <li> {@link NumericRangeQuery}
     <li> {@link org.apache.lucene.search.spans.SpanQuery}
     </ul>
     <p>A parser for queries is contained in:
@@ -146,7 +147,7 @@
    * correspondence with queries). This is an optimization of the OR of
    * all queries. We handle the common optimization cases of equal
    * queries and overlapping clauses of boolean OR queries (as generated
-   * by MultiTermQuery.rewrite() and RangeQuery.rewrite()).
+   * by MultiTermQuery.rewrite()).
    * Be careful overriding this method as queries[0] determines which
    * method will be called and is not necessarily of the same type as
    * the other queries.

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java Sat Jul  4 20:14:12 2009
@@ -26,10 +26,10 @@
  * Constrains search results to only match those which also match a provided
  * query.  
  *
- * <p> This could be used, for example, with a {@link RangeQuery} on a suitably
+ * <p> This could be used, for example, with a {@link TermRangeQuery} on a suitably
  * formatted date field to implement date filtering.  One could re-use a single
  * QueryFilter that matches, e.g., only documents modified within the last
- * week.  The QueryFilter and RangeQuery would only need to be reconstructed
+ * week.  The QueryFilter and TermRangeQuery would only need to be reconstructed
  * once per day.
  *
  * @version $Id:$

Copied: lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeFilter.java (from r790472, lucene/java/trunk/src/java/org/apache/lucene/search/RangeFilter.java)
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeFilter.java?p2=lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeFilter.java&p1=lucene/java/trunk/src/java/org/apache/lucene/search/RangeFilter.java&r1=790472&r2=791175&rev=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/RangeFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeFilter.java Sat Jul  4 20:14:12 2009
@@ -30,59 +30,59 @@
  * <p>If you construct a large number of range filters with different ranges but on the 
  * same field, {@link FieldCacheRangeFilter} may have significantly better performance. 
  */
-public class RangeFilter extends MultiTermQueryWrapperFilter {
+public class TermRangeFilter extends MultiTermQueryWrapperFilter {
     
   /**
-     * @param fieldName The field this range applies to
-     * @param lowerTerm The lower bound on this range
-     * @param upperTerm The upper bound on this range
-     * @param includeLower Does this range include the lower bound?
-     * @param includeUpper Does this range include the upper bound?
-     * @throws IllegalArgumentException if both terms are null or if
-     *  lowerTerm is null and includeLower is true (similar for upperTerm
-     *  and includeUpper)
-     */
-    public RangeFilter(String fieldName, String lowerTerm, String upperTerm,
-                       boolean includeLower, boolean includeUpper) {
-        super(new RangeQuery(fieldName, lowerTerm, upperTerm, includeLower, includeUpper));
-    }
+   * @param fieldName The field this range applies to
+   * @param lowerTerm The lower bound on this range
+   * @param upperTerm The upper bound on this range
+   * @param includeLower Does this range include the lower bound?
+   * @param includeUpper Does this range include the upper bound?
+   * @throws IllegalArgumentException if both terms are null or if
+   *  lowerTerm is null and includeLower is true (similar for upperTerm
+   *  and includeUpper)
+   */
+  public TermRangeFilter(String fieldName, String lowerTerm, String upperTerm,
+                     boolean includeLower, boolean includeUpper) {
+      super(new TermRangeQuery(fieldName, lowerTerm, upperTerm, includeLower, includeUpper));
+  }
 
-    /**
-     * <strong>WARNING:</strong> Using this constructor and supplying a non-null
-     * value in the <code>collator</code> parameter will cause every single 
-     * index Term in the Field referenced by lowerTerm and/or upperTerm to be
-     * examined.  Depending on the number of index Terms in this Field, the 
-     * operation could be very slow.
-     *
-     * @param lowerTerm The lower bound on this range
-     * @param upperTerm The upper bound on this range
-     * @param includeLower Does this range include the lower bound?
-     * @param includeUpper Does this range include the upper bound?
-     * @param collator The collator to use when determining range inclusion; set
-     *  to null to use Unicode code point ordering instead of collation.
-     * @throws IllegalArgumentException if both terms are null or if
-     *  lowerTerm is null and includeLower is true (similar for upperTerm
-     *  and includeUpper)
-     */
-    public RangeFilter(String fieldName, String lowerTerm, String upperTerm,
-                       boolean includeLower, boolean includeUpper,
-                       Collator collator) {
-        super(new RangeQuery(fieldName, lowerTerm, upperTerm, includeLower, includeUpper, collator));
-    }
+  /**
+   * <strong>WARNING:</strong> Using this constructor and supplying a non-null
+   * value in the <code>collator</code> parameter will cause every single 
+   * index Term in the Field referenced by lowerTerm and/or upperTerm to be
+   * examined.  Depending on the number of index Terms in this Field, the 
+   * operation could be very slow.
+   *
+   * @param lowerTerm The lower bound on this range
+   * @param upperTerm The upper bound on this range
+   * @param includeLower Does this range include the lower bound?
+   * @param includeUpper Does this range include the upper bound?
+   * @param collator The collator to use when determining range inclusion; set
+   *  to null to use Unicode code point ordering instead of collation.
+   * @throws IllegalArgumentException if both terms are null or if
+   *  lowerTerm is null and includeLower is true (similar for upperTerm
+   *  and includeUpper)
+   */
+  public TermRangeFilter(String fieldName, String lowerTerm, String upperTerm,
+                     boolean includeLower, boolean includeUpper,
+                     Collator collator) {
+      super(new TermRangeQuery(fieldName, lowerTerm, upperTerm, includeLower, includeUpper, collator));
+  }
 
-    /**
-     * Constructs a filter for field <code>fieldName</code> matching
-     * less than or equal to <code>upperTerm</code>.
-     */
-    public static RangeFilter Less(String fieldName, String upperTerm) {
-        return new RangeFilter(fieldName, null, upperTerm, false, true);
-    }
+  /**
+   * Constructs a filter for field <code>fieldName</code> matching
+   * less than or equal to <code>upperTerm</code>.
+   */
+  public static TermRangeFilter Less(String fieldName, String upperTerm) {
+      return new TermRangeFilter(fieldName, null, upperTerm, false, true);
+  }
 
-    /**
-     * Constructs a filter for field <code>fieldName</code> matching
-     * greater than or equal to <code>lowerTerm</code>.
-     */
-    public static RangeFilter More(String fieldName, String lowerTerm) {
-        return new RangeFilter(fieldName, lowerTerm, null, true, false);
-    }
+  /**
+   * Constructs a filter for field <code>fieldName</code> matching
+   * greater than or equal to <code>lowerTerm</code>.
+   */
+  public static TermRangeFilter More(String fieldName, String lowerTerm) {
+      return new TermRangeFilter(fieldName, lowerTerm, null, true, false);
+  }
 }

Copied: lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java (from r790472, lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java)
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java?p2=lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java&p1=lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java&r1=790472&r2=791175&rev=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java Sat Jul  4 20:14:12 2009
@@ -22,21 +22,23 @@
 
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.util.ToStringUtils;
 
 /**
- * A Query that matches documents within an exclusive range.
+ * A Query that matches documents within an exclusive range of terms.
  *
  * <p>This query matches the documents looking for terms that fall into the
  * supplied range according to {@link String#compareTo(String)}. It is not intended
  * for numerical ranges, use {@link NumericRangeQuery} instead.
  *
- * <p>See {@link MultiTermQuery#setConstantScoreRewrite} for the tradeoffs between
+ * <p>This query is in constant score mode per default.
+ * See {@link MultiTermQuery#setConstantScoreRewrite} for the tradeoffs between
  * enabling and disabling constantScoreRewrite mode.
  */
 
-public class RangeQuery extends MultiTermQuery {
-  private Term lowerTerm;
-  private Term upperTerm;
+public class TermRangeQuery extends MultiTermQuery {
+  private String lowerTerm;
+  private String upperTerm;
   private Collator collator;
   private String field;
   private boolean includeLower;
@@ -65,8 +67,8 @@
    *          If true, the <code>upperTerm</code> is
    *          included in the range.
    */
-  public RangeQuery(String field, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper) {
-    init(new Term(field, lowerTerm), new Term(field, upperTerm), includeLower, includeUpper, null);
+  public TermRangeQuery(String field, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper) {
+    this(field, lowerTerm, upperTerm, includeLower, includeUpper, null);
   }
 
   /** Constructs a query selecting all terms greater/equal than
@@ -99,59 +101,27 @@
    *  their membership in the range bounded by <code>lowerTerm</code> and
    *  <code>upperTerm</code>.
    */
-  public RangeQuery(String field, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper,
+  public TermRangeQuery(String field, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper,
                     Collator collator) {
-    init(new Term(field, lowerTerm), new Term(field,upperTerm), includeLower, includeUpper, collator);
-  }
-
-  /** @deprecated Please use {@link #RangeQuery(String,
-   *  String, String, boolean, boolean, Collator)} instead */
-  public RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive,
-                    Collator collator) {
-    init(lowerTerm, upperTerm, inclusive, inclusive, collator);
-  }
-  
-  /** @deprecated Please use {@link #RangeQuery(String,
-   *  String, String, boolean, boolean)} instead */
-  public RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive) {
-    init(lowerTerm, upperTerm, inclusive, inclusive, null);
-  }
-
-  private void init(Term lowerTerm, Term upperTerm, boolean includeLower, boolean includeUpper, Collator collator) {
-    if (lowerTerm == null && upperTerm == null)
-      throw new IllegalArgumentException("At least one term must be non-null");
-    if (lowerTerm != null && upperTerm != null && lowerTerm.field() != upperTerm.field())
-      throw new IllegalArgumentException("Both terms must be for the same field");
-
-    if (lowerTerm == null)
-      this.field = upperTerm.field();
-    else
-      this.field = lowerTerm.field();
+    this.field = field;
     this.lowerTerm = lowerTerm;
     this.upperTerm = upperTerm;
     this.includeLower = includeLower;
     this.includeUpper = includeUpper;
     this.collator = collator;
+    setConstantScoreRewrite(true);
   }
-  
+
   /** Returns the field name for this query */
   public String getField() {
     return field;
   }
-
-  /** Returns the lower term of this range query.
-   *  @deprecated Use {@link #getLowerTermText} instead. */
-  public Term getLowerTerm() { return lowerTerm; }
-
-  /** Returns the upper term of this range query.
-   *  @deprecated Use {@link #getUpperTermText} instead. */
-  public Term getUpperTerm() { return upperTerm; }
   
   /** Returns the lower value of this range query */
-  public String getLowerTermText() { return lowerTerm == null ? null : lowerTerm.text(); }
+  public String getLowerTerm() { return lowerTerm; }
 
   /** Returns the upper value of this range query */
-  public String getUpperTermText() { return upperTerm == null ? null : upperTerm.text(); }
+  public String getUpperTerm() { return upperTerm; }
   
   /** Returns <code>true</code> if the lower endpoint is inclusive */
   public boolean includesLower() { return includeLower; }
@@ -159,18 +129,12 @@
   /** Returns <code>true</code> if the upper endpoint is inclusive */
   public boolean includesUpper() { return includeUpper; }
 
-  /** Returns <code>true</code> if the range query is inclusive 
-   *  @deprecated Use {@link #includesLower}, {@link #includesUpper}  instead. 
-   */
-  public boolean isInclusive() { return includeUpper && includeLower; }
-
   /** Returns the collator used to determine range inclusion, if any. */
   public Collator getCollator() { return collator; }
   
   protected FilteredTermEnum getEnum(IndexReader reader) throws IOException {
-    //TODO: when the deprecated 'Term' constructors are removed we can remove these null checks
-    return new RangeTermEnum(reader, collator, getField(), lowerTerm == null ? null : lowerTerm.text(),
-        upperTerm == null ? null : upperTerm.text(), includeLower, includeUpper);
+    return new TermRangeTermEnum(reader, collator, field, lowerTerm,
+        upperTerm, includeLower, includeUpper);
   }
 
   /** Prints a user-readable version of this query. */
@@ -181,14 +145,11 @@
           buffer.append(":");
       }
       buffer.append(includeLower ? '[' : '{');
-      buffer.append(lowerTerm != null ? lowerTerm.text() : "*");
+      buffer.append(lowerTerm != null ? lowerTerm : "*");
       buffer.append(" TO ");
-      buffer.append(upperTerm != null ? upperTerm.text() : "*");
+      buffer.append(upperTerm != null ? upperTerm : "*");
       buffer.append(includeUpper ? ']' : '}');
-      if (getBoost() != 1.0f) {
-          buffer.append("^");
-          buffer.append(Float.toString(getBoost()));
-      }
+      buffer.append(ToStringUtils.boost(getBoost()));
       return buffer.toString();
   }
 
@@ -213,7 +174,7 @@
       return false;
     if (getClass() != obj.getClass())
       return false;
-    RangeQuery other = (RangeQuery) obj;
+    TermRangeQuery other = (TermRangeQuery) obj;
     if (collator == null) {
       if (other.collator != null)
         return false;

Copied: lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeTermEnum.java (from r790472, lucene/java/trunk/src/java/org/apache/lucene/search/RangeTermEnum.java)
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeTermEnum.java?p2=lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeTermEnum.java&p1=lucene/java/trunk/src/java/org/apache/lucene/search/RangeTermEnum.java&r1=790472&r2=791175&rev=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/RangeTermEnum.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeTermEnum.java Sat Jul  4 20:14:12 2009
@@ -1,5 +1,22 @@
 package org.apache.lucene.search;
 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import java.io.IOException;
 import java.text.Collator;
 
@@ -13,7 +30,7 @@
  * Term enumerations are always ordered by Term.compareTo().  Each term in
  * the enumeration is greater than all that precede it.
  */
-public class RangeTermEnum extends FilteredTermEnum {
+public class TermRangeTermEnum extends FilteredTermEnum {
 
   private Collator collator = null;
   private boolean endEnum = false;
@@ -50,14 +67,14 @@
    * 
    * @throws IOException
    */
-  public RangeTermEnum(IndexReader reader, Collator collator, String field,
+  public TermRangeTermEnum(IndexReader reader, Collator collator, String field,
       String lowerTermText, String upperTermText, boolean includeLower, boolean includeUpper) throws IOException {
     this.collator = collator;
     this.upperTermText = upperTermText;
     this.lowerTermText = lowerTermText;
     this.includeLower = includeLower;
     this.includeUpper = includeUpper;
-    this.field = field;
+    this.field = field.intern();
     
     // do a little bit of normalization...
     // open ended range queries should always be inclusive.

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/package.html
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/package.html?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/package.html (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/package.html Sat Jul  4 20:14:12 2009
@@ -138,11 +138,11 @@
 </p>
 
 <h4>
-    <a href="RangeQuery.html">RangeQuery</a>
+    <a href="TermRangeQuery.html">TermRangeQuery</a>
 </h4>
 
 <p>The
-    <a href="RangeQuery.html">RangeQuery</a>
+    <a href="TermRangeQuery.html">TermRangeQuery</a>
     matches all documents that occur in the
     exclusive range of a lower
     <a href="../index/Term.html">Term</a>

Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java Sat Jul  4 20:14:12 2009
@@ -50,7 +50,7 @@
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.PrefixQuery;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.WildcardQuery;
@@ -431,11 +431,11 @@
 
   public void testRange() throws Exception {
     assertQueryEquals("[ a TO z]", null, "[a TO z]");
-    assertTrue(((RangeQuery)getQuery("[ a TO z]", null)).getConstantScoreRewrite());
+    assertTrue(((TermRangeQuery)getQuery("[ a TO z]", null)).getConstantScoreRewrite());
 
     QueryParser qp = new QueryParser("field", new SimpleAnalyzer());
 	  qp.setConstantScoreRewrite(false);
-    assertFalse(((RangeQuery)qp.parse("[ a TO z]")).getConstantScoreRewrite());
+    assertFalse(((TermRangeQuery)qp.parse("[ a TO z]")).getConstantScoreRewrite());
     
     assertQueryEquals("[ a TO z ]", null, "[a TO z]");
     assertQueryEquals("{ a TO z}", null, "{a TO z}");
@@ -481,7 +481,7 @@
     result = is.search(qp.parse("[ \u0633 TO \u0638 ]"), null, 1000).scoreDocs;
     assertEquals("The index Term should be included.", 1, result.length);
 
-    // Test RangeQuery
+    // Test TermRangeQuery
     qp.setConstantScoreRewrite(false);
     result = is.search(qp.parse("[ \u062F TO \u0698 ]"), null, 1000).scoreDocs;
     assertEquals("The index Term should not be included.", 0, result.length);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java Sat Jul  4 20:14:12 2009
@@ -66,11 +66,11 @@
 
 	// filter that should preserve matches
 	//DateFilter df1 = DateFilter.Before("datefield", now);
-    RangeFilter df1 = new RangeFilter("datefield", DateTools.timeToString(now - 2000, DateTools.Resolution.MILLISECOND),
+    TermRangeFilter df1 = new TermRangeFilter("datefield", DateTools.timeToString(now - 2000, DateTools.Resolution.MILLISECOND),
                                       DateTools.timeToString(now, DateTools.Resolution.MILLISECOND), false, true);
 	// filter that should discard matches
 	//DateFilter df2 = DateFilter.Before("datefield", now - 999999);
-    RangeFilter df2 = new RangeFilter("datefield", DateTools.timeToString(0, DateTools.Resolution.MILLISECOND),
+    TermRangeFilter df2 = new TermRangeFilter("datefield", DateTools.timeToString(0, DateTools.Resolution.MILLISECOND),
                                       DateTools.timeToString(now - 2000, DateTools.Resolution.MILLISECOND), true, false);
 
     // search something that doesn't exist with DateFilter
@@ -127,11 +127,11 @@
 
 	// filter that should preserve matches
 	//DateFilter df1 = DateFilter.After("datefield", now);
-    RangeFilter df1 = new RangeFilter("datefield", DateTools.timeToString(now, DateTools.Resolution.MILLISECOND),
+    TermRangeFilter df1 = new TermRangeFilter("datefield", DateTools.timeToString(now, DateTools.Resolution.MILLISECOND),
                                       DateTools.timeToString(now + 999999, DateTools.Resolution.MILLISECOND), true, false);
 	// filter that should discard matches
 	//DateFilter df2 = DateFilter.After("datefield", now + 999999);
-    RangeFilter df2 = new RangeFilter("datefield", DateTools.timeToString(now + 999999, DateTools.Resolution.MILLISECOND),
+    TermRangeFilter df2 = new TermRangeFilter("datefield", DateTools.timeToString(now + 999999, DateTools.Resolution.MILLISECOND),
                                           DateTools.timeToString(now + 999999999, DateTools.Resolution.MILLISECOND), false, true);
 
     // search something that doesn't exist with DateFilter

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java Sat Jul  4 20:14:12 2009
@@ -30,7 +30,7 @@
 import org.apache.lucene.store.RAMDirectory;
 
 /**
- * A basic 'positive' Unit test class for the RangeFilter class.
+ * A basic 'positive' Unit test class for the FieldCacheRangeFilter class.
  *
  * <p>
  * NOTE: at the moment, this class only tests for 'positive' results,

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java Sat Jul  4 20:14:12 2009
@@ -177,8 +177,8 @@
    * This tests FilteredQuery's rewrite correctness
    */
   public void testRangeQuery() throws Exception {
-    RangeQuery rq = new RangeQuery(
-        new Term("sorter", "b"), new Term("sorter", "d"), true);
+    TermRangeQuery rq = new TermRangeQuery(
+        "sorter", "b", "d", true, true);
 
     Query filteredquery = new FilteredQuery(rq, filter);
     ScoreDoc[] hits = searcher.search(filteredquery, null, 1000).scoreDocs;

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java Sat Jul  4 20:14:12 2009
@@ -87,7 +87,7 @@
 
   /** macro for readability */
   public static Query csrq(String f, String l, String h, boolean il, boolean ih) {
-    RangeQuery query = new RangeQuery(f, l, h, il, ih);
+    TermRangeQuery query = new TermRangeQuery(f, l, h, il, ih);
     query.setConstantScoreRewrite(true);
     return query;
   }
@@ -95,7 +95,7 @@
   /** macro for readability */
   public static Query csrq(String f, String l, String h, boolean il,
       boolean ih, Collator c) {
-    RangeQuery query = new RangeQuery(f, l, h, il, ih, c);
+    TermRangeQuery query = new TermRangeQuery(f, l, h, il, ih, c);
     query.setConstantScoreRewrite(true);
     return query;
   }
@@ -220,10 +220,10 @@
     IndexReader reader = IndexReader.open(small);
     IndexSearcher search = new IndexSearcher(reader);
 
-    // first do a regular RangeQuery which uses term expansion so
+    // first do a regular TermRangeQuery which uses term expansion so
     // docs with more terms in range get higher scores
 
-    Query rq = new RangeQuery(new Term("data", "1"), new Term("data", "4"), T);
+    Query rq = new TermRangeQuery("data", "1", "4", T, T);
 
     ScoreDoc[] expected = search.search(rq, null, 1000).scoreDocs;
     int numHits = expected.length;

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java Sat Jul  4 20:14:12 2009
@@ -226,38 +226,38 @@
       }
       // test inclusive range
       NumericRangeQuery tq=NumericRangeQuery.newIntRange(field, precisionStep, new Integer(lower), new Integer(upper), true, true);
-      RangeQuery cq=new RangeQuery(field, NumericUtils.intToPrefixCoded(lower), NumericUtils.intToPrefixCoded(upper), true, true);
+      TermRangeQuery cq=new TermRangeQuery(field, NumericUtils.intToPrefixCoded(lower), NumericUtils.intToPrefixCoded(upper), true, true);
       cq.setConstantScoreRewrite(true);
       TopDocs tTopDocs = searcher.search(tq, 1);
       TopDocs cTopDocs = searcher.search(cq, 1);
-      assertEquals("Returned count for NumericRangeQuery and RangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
+      assertEquals("Returned count for NumericRangeQuery and TermRangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
       termCountT += tq.getTotalNumberOfTerms();
       termCountC += cq.getTotalNumberOfTerms();
       // test exclusive range
       tq=NumericRangeQuery.newIntRange(field, precisionStep, new Integer(lower), new Integer(upper), false, false);
-      cq=new RangeQuery(field, NumericUtils.intToPrefixCoded(lower), NumericUtils.intToPrefixCoded(upper), false, false);
+      cq=new TermRangeQuery(field, NumericUtils.intToPrefixCoded(lower), NumericUtils.intToPrefixCoded(upper), false, false);
       cq.setConstantScoreRewrite(true);
       tTopDocs = searcher.search(tq, 1);
       cTopDocs = searcher.search(cq, 1);
-      assertEquals("Returned count for NumericRangeQuery and RangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
+      assertEquals("Returned count for NumericRangeQuery and TermRangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
       termCountT += tq.getTotalNumberOfTerms();
       termCountC += cq.getTotalNumberOfTerms();
       // test left exclusive range
       tq=NumericRangeQuery.newIntRange(field, precisionStep, new Integer(lower), new Integer(upper), false, true);
-      cq=new RangeQuery(field, NumericUtils.intToPrefixCoded(lower), NumericUtils.intToPrefixCoded(upper), false, true);
+      cq=new TermRangeQuery(field, NumericUtils.intToPrefixCoded(lower), NumericUtils.intToPrefixCoded(upper), false, true);
       cq.setConstantScoreRewrite(true);
       tTopDocs = searcher.search(tq, 1);
       cTopDocs = searcher.search(cq, 1);
-      assertEquals("Returned count for NumericRangeQuery and RangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
+      assertEquals("Returned count for NumericRangeQuery and TermRangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
       termCountT += tq.getTotalNumberOfTerms();
       termCountC += cq.getTotalNumberOfTerms();
       // test right exclusive range
       tq=NumericRangeQuery.newIntRange(field, precisionStep, new Integer(lower), new Integer(upper), true, false);
-      cq=new RangeQuery(field, NumericUtils.intToPrefixCoded(lower), NumericUtils.intToPrefixCoded(upper), true, false);
+      cq=new TermRangeQuery(field, NumericUtils.intToPrefixCoded(lower), NumericUtils.intToPrefixCoded(upper), true, false);
       cq.setConstantScoreRewrite(true);
       tTopDocs = searcher.search(tq, 1);
       cTopDocs = searcher.search(cq, 1);
-      assertEquals("Returned count for NumericRangeQuery and RangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
+      assertEquals("Returned count for NumericRangeQuery and TermRangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
       termCountT += tq.getTotalNumberOfTerms();
       termCountC += cq.getTotalNumberOfTerms();
     }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java?rev=791175&r1=791174&r2=791175&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java Sat Jul  4 20:14:12 2009
@@ -226,38 +226,38 @@
       }
       // test inclusive range
       NumericRangeQuery tq=NumericRangeQuery.newLongRange(field, precisionStep, new Long(lower), new Long(upper), true, true);
-      RangeQuery cq=new RangeQuery(field, NumericUtils.longToPrefixCoded(lower), NumericUtils.longToPrefixCoded(upper), true, true);
+      TermRangeQuery cq=new TermRangeQuery(field, NumericUtils.longToPrefixCoded(lower), NumericUtils.longToPrefixCoded(upper), true, true);
       cq.setConstantScoreRewrite(true);
       TopDocs tTopDocs = searcher.search(tq, 1);
       TopDocs cTopDocs = searcher.search(cq, 1);
-      assertEquals("Returned count for NumericRangeQuery and RangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
+      assertEquals("Returned count for NumericRangeQuery and TermRangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
       termCountT += tq.getTotalNumberOfTerms();
       termCountC += cq.getTotalNumberOfTerms();
       // test exclusive range
       tq=NumericRangeQuery.newLongRange(field, precisionStep, new Long(lower), new Long(upper), false, false);
-      cq=new RangeQuery(field, NumericUtils.longToPrefixCoded(lower), NumericUtils.longToPrefixCoded(upper), false, false);
+      cq=new TermRangeQuery(field, NumericUtils.longToPrefixCoded(lower), NumericUtils.longToPrefixCoded(upper), false, false);
       cq.setConstantScoreRewrite(true);
       tTopDocs = searcher.search(tq, 1);
       cTopDocs = searcher.search(cq, 1);
-      assertEquals("Returned count for NumericRangeQuery and RangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
+      assertEquals("Returned count for NumericRangeQuery and TermRangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
       termCountT += tq.getTotalNumberOfTerms();
       termCountC += cq.getTotalNumberOfTerms();
       // test left exclusive range
       tq=NumericRangeQuery.newLongRange(field, precisionStep, new Long(lower), new Long(upper), false, true);
-      cq=new RangeQuery(field, NumericUtils.longToPrefixCoded(lower), NumericUtils.longToPrefixCoded(upper), false, true);
+      cq=new TermRangeQuery(field, NumericUtils.longToPrefixCoded(lower), NumericUtils.longToPrefixCoded(upper), false, true);
       cq.setConstantScoreRewrite(true);
       tTopDocs = searcher.search(tq, 1);
       cTopDocs = searcher.search(cq, 1);
-      assertEquals("Returned count for NumericRangeQuery and RangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
+      assertEquals("Returned count for NumericRangeQuery and TermRangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
       termCountT += tq.getTotalNumberOfTerms();
       termCountC += cq.getTotalNumberOfTerms();
       // test right exclusive range
       tq=NumericRangeQuery.newLongRange(field, precisionStep, new Long(lower), new Long(upper), true, false);
-      cq=new RangeQuery(field, NumericUtils.longToPrefixCoded(lower), NumericUtils.longToPrefixCoded(upper), true, false);
+      cq=new TermRangeQuery(field, NumericUtils.longToPrefixCoded(lower), NumericUtils.longToPrefixCoded(upper), true, false);
       cq.setConstantScoreRewrite(true);
       tTopDocs = searcher.search(tq, 1);
       cTopDocs = searcher.search(cq, 1);
-      assertEquals("Returned count for NumericRangeQuery and RangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
+      assertEquals("Returned count for NumericRangeQuery and TermRangeQuery must be equal", cTopDocs.totalHits, tTopDocs.totalHits );
       termCountT += tq.getTotalNumberOfTerms();
       termCountC += cq.getTotalNumberOfTerms();
     }



Mime
View raw message