diff --git a/lucene/contrib/CHANGES.txt b/lucene/contrib/CHANGES.txt index 2fa5c4fb996..46a60c87712 100644 --- a/lucene/contrib/CHANGES.txt +++ b/lucene/contrib/CHANGES.txt @@ -42,11 +42,19 @@ API Changes Instead, use SimilarityProvider to return different SweetSpotSimilaritys for different fields, this way all parameters (such as TF factors) can be customized on a per-field basis. (Robert Muir) + +Bug Fixes + + * LUCENE-3045: fixed QueryNodeImpl.containsTag(String key) that was + not lowercasing the key before checking for the tag (Adriano Crestani) ======================= Lucene 3.x (not yet released) ======================= Bug Fixes + * LUCENE-3045: fixed QueryNodeImpl.containsTag(String key) that was + not lowercasing the key before checking for the tag (Adriano Crestani) + * LUCENE-3026: SmartChineseAnalyzer's WordTokenFilter threw NullPointerException on sentences longer than 32,767 characters. (wangzhenghang via Robert Muir) diff --git a/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/QueryNodeImpl.java b/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/QueryNodeImpl.java index 745d8f1529c..dcc4811febc 100644 --- a/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/QueryNodeImpl.java +++ b/lucene/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/QueryNodeImpl.java @@ -160,7 +160,7 @@ public abstract class QueryNodeImpl implements QueryNode, Cloneable { /** verify if a node contains a tag */ public boolean containsTag(String tagName) { - return this.tags.containsKey(tagName); + return this.tags.containsKey(tagName.toLowerCase()); } public Object getTag(String tagName) { diff --git a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/core/nodes/TestQueryNode.java b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/core/nodes/TestQueryNode.java index 23d4fb4ef4c..b805a438ce1 100644 --- a/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/core/nodes/TestQueryNode.java +++ b/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/core/nodes/TestQueryNode.java @@ -32,4 +32,16 @@ public class TestQueryNode extends LuceneTestCase { bq.add(Arrays.asList(nodeB)); assertEquals(2, bq.getChildren().size()); } + + /* LUCENE-3045 bug in QueryNodeImpl.containsTag(String key)*/ + public void testTags() throws Exception { + QueryNode node = new FieldQueryNode("foo", "A", 0, 1); + + node.setTag("TaG", new Object()); + assertTrue(node.getTagMap().size() > 0); + assertTrue(node.containsTag("tAg")); + assertTrue(node.getTag("tAg") != null); + + } + }