mirror of https://github.com/apache/lucene.git
SOLR-1826: Add tests for highlighting with termOffsets=true and overlapping tokens
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1063702 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e76ad0990d
commit
20621a4e72
|
@ -733,6 +733,9 @@ Other Changes
|
|||
|
||||
* SOLR-2213: Upgrade to jQuery 1.4.3 (Erick Erickson via ryan)
|
||||
|
||||
* SOLR-1826: Add unit tests for highlighting with termOffsets=true
|
||||
and overlapping tokens. (Stefan Oestreicher via rmuir)
|
||||
|
||||
|
||||
Build
|
||||
----------------------
|
||||
|
|
|
@ -483,6 +483,7 @@
|
|||
<field name="nullfirst" type="string" indexed="true" stored="true" sortMissingFirst="true"/>
|
||||
|
||||
<field name="subword" type="subword" indexed="true" stored="true"/>
|
||||
<field name="subword_offsets" type="subword" indexed="true" stored="true" termOffsets="true"/>
|
||||
<field name="numericsubword" type="numericsubword" indexed="true" stored="true"/>
|
||||
<field name="protectedsubword" type="protectedsubword" indexed="true" stored="true"/>
|
||||
|
||||
|
|
|
@ -769,4 +769,30 @@ public class HighlighterTest extends SolrTestCaseJ4 {
|
|||
);
|
||||
|
||||
}
|
||||
|
||||
public void testSubwordWildcardHighlight() {
|
||||
assertU(adoc("subword", "lorem PowerShot.com ipsum", "id", "1"));
|
||||
assertU(commit());
|
||||
assertQ("subword wildcard highlighting",
|
||||
req("q", "subword:pow*", "hl", "true", "hl.fl", "subword"),
|
||||
"//lst[@name='highlighting']/lst[@name='1']" +
|
||||
"/arr[@name='subword']/str='lorem <em>PowerShot.com</em> ipsum'");
|
||||
}
|
||||
|
||||
public void testSubwordWildcardHighlightWithTermOffsets() {
|
||||
assertU(adoc("subword_offsets", "lorem PowerShot.com ipsum", "id", "1"));
|
||||
assertU(commit());
|
||||
assertQ("subword wildcard highlighting",
|
||||
req("q", "subword_offsets:pow*", "hl", "true", "hl.fl", "subword_offsets"),
|
||||
"//lst[@name='highlighting']/lst[@name='1']" +
|
||||
"/arr[@name='subword_offsets']/str='lorem <em>PowerShot.com</em> ipsum'");
|
||||
}
|
||||
public void testSubwordWildcardHighlightWithTermOffsets2() {
|
||||
assertU(adoc("subword_offsets", "lorem PowerShot ipsum", "id", "1"));
|
||||
assertU(commit());
|
||||
assertQ("subword wildcard highlighting",
|
||||
req("q", "subword_offsets:pow*", "hl", "true", "hl.fl", "subword_offsets"),
|
||||
"//lst[@name='highlighting']/lst[@name='1']" +
|
||||
"/arr[@name='subword_offsets']/str='lorem <em>PowerShot</em> ipsum'");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue