Skip to content

Apache Lucene open-source search software

LUCENE-3019: fix unexpected color tags for FVH

Koji Sekiguchi5f9c4235dc05
diff --git a/lucene/contrib/CHANGES.txt b/lucene/contrib/CHANGES.txt
index 53f06ac7871..f9474ffeb61 100644
--- a/lucene/contrib/CHANGES.txt
+++ b/lucene/contrib/CHANGES.txt
@@ -90,6 +90,8 @@ Bug Fixes
* LUCENE-3417: DictionaryCompoundWordFilter did not properly add tokens from the
end compound word. (Njal Karevoll via Robert Muir)
+ * LUCENE-3019: Fix unexpected color tags for FastVectorHighlighter. (Koji Sekiguchi)
+
======================= Lucene 3.4.0 ================
New Features
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 a402d415fae..e329136647c 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,6 +17,7 @@ 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;
@@ -59,7 +60,7 @@ public class FieldQuery {
FieldQuery( Query query, IndexReader reader, boolean phraseHighlight, boolean fieldMatch ) throws IOException {
this.fieldMatch = fieldMatch;
- Set<Query> flatQueries = new HashSet<Query>();
+ List<Query> flatQueries = new ArrayList<Query>();
flatten( query, reader, flatQueries );
saveTerms( flatQueries, reader );
Collection<Query> expandQueries = expand( flatQueries );
@@ -132,7 +133,7 @@ public class FieldQuery {
* => expandQueries={a,"b c","c d","b c d"}
*/
Collection<Query> expand( Collection<Query> flatQueries ){
- Set<Query> expandQueries = new HashSet<Query>();
+ List<Query> expandQueries = new ArrayList<Query>();
for( Iterator<Query> i = flatQueries.iterator(); i.hasNext(); ){
Query query = i.next();
i.remove();