lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r988638 - in /lucene/java/branches/lucene_3_0: ./ contrib/ contrib/analyzers/ contrib/analyzers/common/ contrib/analyzers/common/src/test/ contrib/analyzers/smartcn/ contrib/highlighter/ contrib/highlighter/src/test/ contrib/instantiated/sr...
Date Tue, 24 Aug 2010 18:06:18 GMT
Author: rmuir
Date: Tue Aug 24 18:06:18 2010
New Revision: 988638

URL: http://svn.apache.org/viewvc?rev=988638&view=rev
Log:
LUCENE-2620: Fix WildcardQuery bug where too many asterisks results in unbearably slow performance

Modified:
    lucene/java/branches/lucene_3_0/   (props changed)
    lucene/java/branches/lucene_3_0/CHANGES.txt
    lucene/java/branches/lucene_3_0/build.xml   (props changed)
    lucene/java/branches/lucene_3_0/contrib/   (props changed)
    lucene/java/branches/lucene_3_0/contrib/CHANGES.txt   (props changed)
    lucene/java/branches/lucene_3_0/contrib/analyzers/   (props changed)
    lucene/java/branches/lucene_3_0/contrib/analyzers/common/   (props changed)
    lucene/java/branches/lucene_3_0/contrib/analyzers/common/src/test/   (props changed)
    lucene/java/branches/lucene_3_0/contrib/analyzers/smartcn/   (props changed)
    lucene/java/branches/lucene_3_0/contrib/highlighter/   (props changed)
    lucene/java/branches/lucene_3_0/contrib/highlighter/src/test/   (props changed)
    lucene/java/branches/lucene_3_0/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
  (props changed)
    lucene/java/branches/lucene_3_0/src/   (props changed)
    lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/analysis/Tokenizer.java   (props
changed)
    lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
  (props changed)
    lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/WildcardTermEnum.java
    lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
  (props changed)
    lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java
  (props changed)
    lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java
  (props changed)
    lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/   (props changed)
    lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
  (props changed)
    lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestWildcard.java
    lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/util/TestAttributeSource.java
  (props changed)

Propchange: lucene/java/branches/lucene_3_0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,963781,965103,984187
 /lucene/java/branches/lucene_2_4:748824
 /lucene/java/branches/lucene_2_9:817269-818600,825998,829134,829881,831036,896850,909334,940987,948516

Modified: lucene/java/branches/lucene_3_0/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/CHANGES.txt?rev=988638&r1=988637&r2=988638&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/CHANGES.txt (original)
+++ lucene/java/branches/lucene_3_0/CHANGES.txt Tue Aug 24 18:06:18 2010
@@ -29,6 +29,9 @@ Bug fixes
 
 * LUCENE-2593: Fixed certain rare cases where a disk full could lead
   to a corrupted index (Robert Muir, Mike McCandless)
+  
+* LUCENE-2620: Fixed a bug in WildcardQuery where too many asterisks
+  would result in unbearably slow performance.  (Nick Barkas via Robert Muir)
 
 ======================= Release 3.0.2 2010-06-18 =======================
 

Propchange: lucene/java/branches/lucene_3_0/build.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/build.xml:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/build.xml:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/build.xml:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,963781,965103,984187
 /lucene/java/branches/lucene_2_4/build.xml:748824
 /lucene/java/branches/lucene_2_9/build.xml:817269-818600,825998,829134,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/contrib:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/contrib:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/contrib:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,963781,965103,984187
 /lucene/java/branches/lucene_2_4/contrib:748824
 /lucene/java/branches/lucene_2_9/contrib:817269-818600,825998,829134,829816,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/contrib/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/contrib/CHANGES.txt:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/contrib/CHANGES.txt:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/contrib/CHANGES.txt:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,963781,965103,984187
 /lucene/java/branches/lucene_2_4/contrib/CHANGES.txt:748824
 /lucene/java/branches/lucene_2_9/contrib/CHANGES.txt:817269-818600,825998,826775,829134,829816,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/contrib/analyzers/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,3 +1,3 @@
-/lucene/dev/branches/branch_3x/lucene/contrib/analyzers:941394,946651,957490,984210
+/lucene/dev/branches/branch_3x/lucene/contrib/analyzers:941394,946651,957490,984210,988629
 /lucene/dev/trunk/lucene/contrib/analyzers:929738,935522,939611,940730,948429,949288,949976,949997,950458,950613,951521,963781,965103,984187
 /lucene/java/trunk/contrib/analyzers:887670,889579,889866,890439,891205,891377,920270

Propchange: lucene/java/branches/lucene_3_0/contrib/analyzers/common/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1 +1,2 @@
+/lucene/dev/branches/branch_3x/lucene/contrib/analyzers/common:988629
 /lucene/dev/trunk/lucene/contrib/analyzers/common:984187

Propchange: lucene/java/branches/lucene_3_0/contrib/analyzers/common/src/test/
            ('svn:mergeinfo' removed)

Propchange: lucene/java/branches/lucene_3_0/contrib/analyzers/smartcn/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1 +1,2 @@
+/lucene/dev/branches/branch_3x/lucene/contrib/analyzers/smartcn:988629
 /lucene/dev/trunk/lucene/contrib/analyzers/smartcn:984187

Propchange: lucene/java/branches/lucene_3_0/contrib/highlighter/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1 +1,2 @@
+/lucene/dev/branches/branch_3x/lucene/contrib/highlighter:988629
 /lucene/dev/trunk/lucene/contrib/highlighter:984187

Propchange: lucene/java/branches/lucene_3_0/contrib/highlighter/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/contrib/highlighter/src/test:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/contrib/highlighter/src/test:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/contrib/highlighter/src/test:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,963781,965103,984187
 /lucene/java/branches/lucene_2_4/contrib/highlighter/src/test:748824
 /lucene/java/branches/lucene_2_9/contrib/highlighter/src/test:817269-818600,825998,826775,829134,829816,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,963781,965103,984187
 /lucene/java/branches/lucene_2_4/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:748824
 /lucene/java/branches/lucene_2_9/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:817269-818600,825998,829134,829816,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/src:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/src:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /lucene/java/branches/lucene_2_4/src:748824
 /lucene/java/branches/lucene_2_9/src:817269-818600,825998,829134,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/analysis/Tokenizer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /lucene/java/branches/lucene_2_4/src/java/org/apache/lucene/analysis/Tokenizer.java:748824
 /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/analysis/Tokenizer.java:817269-818600,825998,829134,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /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,896850,909334,940987,948516

Modified: lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/WildcardTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/WildcardTermEnum.java?rev=988638&r1=988637&r2=988638&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/WildcardTermEnum.java
(original)
+++ lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/WildcardTermEnum.java
Tue Aug 24 18:06:18 2010
@@ -168,8 +168,9 @@ public class WildcardTermEnum extends Fi
         //
         if (pattern.charAt(p) == WILDCARD_STRING)
         {
-          // Look at the character beyond the '*'.
-          ++p;
+          // Look at the character beyond the '*' characters.
+          while (p < pattern.length() && pattern.charAt(p) == WILDCARD_STRING)
+            ++p;
           // Examine the string, starting at the last character.
           for (int i = string.length(); i >= s; --i)
           {

Propchange: lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:825998,829134,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/document/TestDateTools.java:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/document/TestDateTools.java:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/src/test/org/apache/lucene/document/TestDateTools.java:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:825998,829134,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/document/TestNumberTools.java:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/document/TestNumberTools.java:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/src/test/org/apache/lucene/document/TestNumberTools.java:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:825998,829134,829881,831036,896850,909334,940987,948516

Propchange: lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,3 +1,3 @@
-/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index:941394,946651,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index:941394,946651,957490,984210,988629
 /lucene/dev/trunk/lucene/src/test/org/apache/lucene/index:929738,935522,940730,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /lucene/java/trunk/src/test/org/apache/lucene/index:887670,889579,889866,890439,891205,891377,920270

Propchange: lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:825998,829134,829881,831036,896850,909334,940987,948516

Modified: lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestWildcard.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestWildcard.java?rev=988638&r1=988637&r2=988638&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestWildcard.java (original)
+++ lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestWildcard.java Tue
Aug 24 18:06:18 2010
@@ -184,6 +184,26 @@ public class TestWildcard
   }
 
   /**
+   * LUCENE-2620
+   */
+  public void testLotsOfAsterisks()
+      throws IOException {
+    RAMDirectory indexStore = getIndexStore("body", new String[]
+    {"metal", "metals"});
+    IndexSearcher searcher = new IndexSearcher(indexStore, true);
+    StringBuilder term = new StringBuilder();
+    term.append("m");
+    for (int i = 0; i < 512; i++)
+      term.append("*");
+    term.append("tal");
+    Query query3 = new WildcardQuery(new Term("body", term.toString()));
+
+    assertMatches(searcher, query3, 1);
+    searcher.close();
+    indexStore.close();
+  }
+  
+  /**
    * Tests Wildcard queries with a question mark.
    *
    * @throws IOException if an error occurs

Propchange: lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 24 18:06:18 2010
@@ -1,4 +1,4 @@
-/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/util/TestAttributeSource.java:941394,946651,948430,957490,984210
+/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/util/TestAttributeSource.java:941394,946651,948430,957490,984210,988629
 /lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestAttributeSource.java:929738,932398,935522,938989,939611,939649,940730,945420,946599,948082,948429,949288,949976,949997,950458,950613,951521,953407,963781,965103,984187
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/util/TestAttributeSource.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/util/TestAttributeSource.java:817269-818600,825998,829134,829881,831036,896850,909334,940987,948516



Mime
View raw message