lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r882467 - in /lucene/java/branches/lucene_3_0: CHANGES.txt src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
Date Fri, 20 Nov 2009 09:42:09 GMT
Author: uschindler
Date: Fri Nov 20 09:42:08 2009
New Revision: 882467

URL: http://svn.apache.org/viewvc?rev=882467&view=rev
Log:
merge some changes from trunk for the final release of 3.0. No more RC needed as everybody
seems to be happy.

Modified:
    lucene/java/branches/lucene_3_0/CHANGES.txt   (contents, props changed)
    lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
  (contents, props changed)

Modified: lucene/java/branches/lucene_3_0/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/CHANGES.txt?rev=882467&r1=882466&r2=882467&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/CHANGES.txt (original)
+++ lucene/java/branches/lucene_3_0/CHANGES.txt Fri Nov 20 09:42:08 2009
@@ -37,6 +37,9 @@
   this is a change in the default from 2.9, when these methods were
   previously deprecated.  (Mike McCandless)
 
+* LUCENE-1753: Make not yet final TokenStreams final to enforce 
+  decorator pattern. (Uwe Schindler)
+
 Changes in runtime behavior
 
 * LUCENE-1677: Remove the system property to set SegmentReader class
@@ -70,20 +73,31 @@
 
 API Changes
 
-* LUCENE-1257, LUCENE-1984, LUCENE-1985, LUCENE-2057: Port to Java 1.5.
-  (Uwe Schindler, Robert Muir, Karl Wettin, Paul Elschot, Kay Kay, Shai Erera)
+* LUCENE-1257, LUCENE-1984, LUCENE-1985, LUCENE-2057, LUCENE-1833, LUCENE-2012,
+  LUCENE-1998: Port to Java 1.5:
+
+  - Add generics to public and internal APIs (see below).
+  - Replace new Integer(int), new Double(double),... by static valueOf() calls.
+  - Replace for-loops with Iterator by foreach loops.
+  - Replace StringBuffer with StringBuilder.
+  - Replace o.a.l.util.Parameter by Java 5 enums (see below).
+  - Add @Override annotations.
+  (Uwe Schindler, Robert Muir, Karl Wettin, Paul Elschot, Kay Kay, Shai Erera,
+  DM Smith)
 
 * Generify Lucene API:
 
   - TokenStream/AttributeSource: Now addAttribute()/getAttribute() return an
-    instance of the requested attribute interface and no cast needed anymore.
+    instance of the requested attribute interface and no cast needed anymore
+    (LUCENE-1855).
   - NumericRangeQuery, NumericRangeFilter, and FieldCacheRangeFilter
-    now have Integer, Long, Float, Double as type param.
-  - Document.getFields() returns List<Fieldable>
+    now have Integer, Long, Float, Double as type param (LUCENE-1857).
+  - Document.getFields() returns List<Fieldable>.
   - Query.extractTerms(Set<Term>)
   - CharArraySet and stop word sets in core/contrib
-  - PriorityQueue
+  - PriorityQueue (LUCENE-1935)
   - TopDocCollector
+  - DisjunctionMaxQuery (LUCENE-1984)
   - MultiTermQueryWrapperFilter
   - CloseableThreadLocal
   - MapOfSets
@@ -96,7 +110,7 @@
   LUCENE-1972, LUCENE-1978, LUCENE-944, LUCENE-1979, LUCENE-1973, LUCENE-2011:
   Remove deprecated methods/constructors/classes:
 
-  - All String/File directory paths in IndexReader /
+  - Remove all String/File directory paths in IndexReader /
     IndexSearcher / IndexWriter.
   - Remove FSDirectory.getDirectory()
   - Make FSDirectory abstract.
@@ -110,13 +124,13 @@
   - Remove SpanQuery.getTerms().
   - Remove ExtendedFieldCache, custom and auto caches, SortField.AUTO.
   - Remove old-style custom sort.
-  - Remove Legacy search setting in SortField.
+  - Remove legacy search setting in SortField.
   - Remove Hits and all references from core and contrib.
   - Remove HitCollector and its TopDocs support implementations.
   - Remove term field and accessors in MultiTermQuery
     (and fix Highlighter).
-  - Remove methods in BooleanQuery.
-  - Remove methods in Similarity.
+  - Remove deprecated methods in BooleanQuery.
+  - Remove deprecated methods in Similarity.
   - Remove BoostingTermQuery.
   - Remove MultiValueSource.
   - Remove Scorer.explain(int).
@@ -126,9 +140,6 @@
   protected; add expert ctor to directly specify reader, subReaders
   and docStarts.  (John Wang, Tim Smith via Mike McCandless)
 
-* LUCENE-1753: Make not yet final TokenStreams final to enforce 
-  decorator pattern. (Uwe Schindler)
-
 * LUCENE-1945: All public classes that have a close() method now
   also implement java.io.Closeable (IndexReader, IndexWriter, Directory,...).
   (Uwe Schindler)

Propchange: lucene/java/branches/lucene_3_0/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Nov 20 09:42:08 2009
@@ -0,0 +1,4 @@
+/lucene/java/branches/lucene_2_4/CHANGES.txt:748824
+/lucene/java/branches/lucene_2_9/CHANGES.txt:817269-818600,825998,829134,829881,831036
+/lucene/java/branches/lucene_2_9_back_compat_tests/CHANGES.txt:818601-821336
+/lucene/java/trunk/CHANGES.txt:881213,881315,881466,882464

Modified: lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java?rev=882467&r1=882466&r2=882467&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
(original)
+++ lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
Fri Nov 20 09:42:08 2009
@@ -93,9 +93,20 @@
   public void clearTotalNumberOfTerms() {
     query.clearTotalNumberOfTerms();
   }
-
-  abstract class TermGenerator {
-    public void generate(IndexReader reader, TermEnum enumerator) throws IOException {
+  
+  /**
+   * Returns a DocIdSet with documents that should be
+   * permitted in search results.
+   */
+  @Override
+  public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
+    final TermEnum enumerator = query.getEnum(reader);
+    try {
+      // if current term in enum is null, the enum is empty -> shortcut
+      if (enumerator.term() == null)
+        return DocIdSet.EMPTY_DOCIDSET;
+      // else fill into a OpenBitSet
+      final OpenBitSet bitSet = new OpenBitSet(reader.maxDoc());
       final int[] docs = new int[32];
       final int[] freqs = new int[32];
       TermDocs termDocs = reader.termDocs();
@@ -111,7 +122,7 @@
             final int count = termDocs.read(docs, freqs);
             if (count != 0) {
               for(int i=0;i<count;i++) {
-                handleDoc(docs[i]);
+                bitSet.set(docs[i]);
               }
             } else {
               break;
@@ -124,29 +135,6 @@
       } finally {
         termDocs.close();
       }
-    }
-    abstract public void handleDoc(int doc);
-  }
-  
-  /**
-   * Returns a DocIdSet with documents that should be
-   * permitted in search results.
-   */
-  @Override
-  public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
-    final TermEnum enumerator = query.getEnum(reader);
-    try {
-      // if current term in enum is null, the enum is empty -> shortcut
-      if (enumerator.term() == null)
-        return DocIdSet.EMPTY_DOCIDSET;
-      // else fill into a OpenBitSet
-      final OpenBitSet bitSet = new OpenBitSet(reader.maxDoc());
-      new TermGenerator() {
-        @Override
-        public void handleDoc(int doc) {
-          bitSet.set(doc);
-        }
-      }.generate(reader, enumerator);
       return bitSet;
     } finally {
       enumerator.close();

Propchange: lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Nov 20 09:42:08 2009
@@ -0,0 +1,4 @@
+/lucene/java/branches/lucene_2_4/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:748824
+/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:817269-818600,825998,829134,829881,831036
+/lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:818601-821336
+/lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:881213,881315,881466,881984



Mime
View raw message