From 4f26f195eb24a458913b183e8c59255daae0074c Mon Sep 17 00:00:00 2001 From: Koji Sekiguchi Date: Mon, 30 Jan 2012 02:02:53 +0000 Subject: [PATCH 1/2] LUCENE-3719:FVH: slow performance on very large queries git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1237528 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/contrib/CHANGES.txt | 3 +++ .../apache/lucene/search/vectorhighlight/FieldQuery.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lucene/contrib/CHANGES.txt b/lucene/contrib/CHANGES.txt index 9c0b3e1d6ef..3c646719681 100644 --- a/lucene/contrib/CHANGES.txt +++ b/lucene/contrib/CHANGES.txt @@ -200,6 +200,9 @@ Bug Fixes * LUCENE-3697: SimpleBoundaryScanner does not work well when highlighting at the beginning of the text. (Shay Banon via Koji Sekiguchi) + * LUCENE-3719: FVH: slow performance on very large queries. + (Igor Motov via Koji Sekiguchi) + Documentation * LUCENE-3599: Javadocs for DistanceUtils.haversine() were incorrectly diff --git a/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java b/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java index e329136647c..c5f8d76de46 100644 --- a/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java +++ b/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java @@ -17,11 +17,11 @@ package org.apache.lucene.search.vectorhighlight; */ import java.io.IOException; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -60,7 +60,7 @@ public class FieldQuery { FieldQuery( Query query, IndexReader reader, boolean phraseHighlight, boolean fieldMatch ) throws IOException { this.fieldMatch = fieldMatch; - List flatQueries = new ArrayList(); + Set flatQueries = new LinkedHashSet(); flatten( query, reader, flatQueries ); saveTerms( flatQueries, reader ); Collection expandQueries = expand( flatQueries ); @@ -133,7 +133,7 @@ public class FieldQuery { * => expandQueries={a,"b c","c d","b c d"} */ Collection expand( Collection flatQueries ){ - List expandQueries = new ArrayList(); + Set expandQueries = new LinkedHashSet(); for( Iterator i = flatQueries.iterator(); i.hasNext(); ){ Query query = i.next(); i.remove(); From e1cb5229210dd8ef922237bdbecee2173f6d252f Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Mon, 30 Jan 2012 02:57:42 +0000 Subject: [PATCH 2/2] SOLR-3066: check if waiting twice as long for solrindexsearchers to be returned changes anything with searcher cnt mismatch git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1237536 13f79535-47bb-0310-9956-ffa450edef68 --- .../test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java index c514c0d993f..089a1f84308 100755 --- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java +++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java @@ -132,7 +132,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase { // wait a bit in case any ending threads have anything to release int retries = 0; while (endNumOpens - numOpens != endNumCloses - numCloses) { - if (retries++ > 60) { + if (retries++ > 120) { break; } try {