mirror of https://github.com/apache/lucene.git
LUCENE-3045: QueryNodeImpl.containsTag(String) should lowercase the tag key
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1096983 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3dd0b7f278
commit
5432f9de62
|
@ -42,11 +42,19 @@ API Changes
|
||||||
Instead, use SimilarityProvider to return different SweetSpotSimilaritys
|
Instead, use SimilarityProvider to return different SweetSpotSimilaritys
|
||||||
for different fields, this way all parameters (such as TF factors) can be
|
for different fields, this way all parameters (such as TF factors) can be
|
||||||
customized on a per-field basis. (Robert Muir)
|
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) =======================
|
======================= Lucene 3.x (not yet released) =======================
|
||||||
|
|
||||||
Bug Fixes
|
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
|
* LUCENE-3026: SmartChineseAnalyzer's WordTokenFilter threw NullPointerException
|
||||||
on sentences longer than 32,767 characters. (wangzhenghang via Robert Muir)
|
on sentences longer than 32,767 characters. (wangzhenghang via Robert Muir)
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ public abstract class QueryNodeImpl implements QueryNode, Cloneable {
|
||||||
|
|
||||||
/** verify if a node contains a tag */
|
/** verify if a node contains a tag */
|
||||||
public boolean containsTag(String tagName) {
|
public boolean containsTag(String tagName) {
|
||||||
return this.tags.containsKey(tagName);
|
return this.tags.containsKey(tagName.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getTag(String tagName) {
|
public Object getTag(String tagName) {
|
||||||
|
|
|
@ -32,4 +32,16 @@ public class TestQueryNode extends LuceneTestCase {
|
||||||
bq.add(Arrays.asList(nodeB));
|
bq.add(Arrays.asList(nodeB));
|
||||||
assertEquals(2, bq.getChildren().size());
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue