lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1063706 - in /lucene/dev/branches/branch_3x: ./ lucene/ solr/ solr/CHANGES.txt solr/src/test-files/solr/conf/schema.xml solr/src/test/org/apache/solr/highlight/HighlighterTest.java
Date Wed, 26 Jan 2011 13:06:41 GMT
Author: rmuir
Date: Wed Jan 26 13:06:40 2011
New Revision: 1063706

URL: http://svn.apache.org/viewvc?rev=1063706&view=rev
Log:
SOLR-1826: Add tests for highlighting with termOffsets=true and overlapping tokens

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/solr/   (props changed)
    lucene/dev/branches/branch_3x/solr/CHANGES.txt
    lucene/dev/branches/branch_3x/solr/src/test-files/solr/conf/schema.xml
    lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/highlight/HighlighterTest.java

Modified: lucene/dev/branches/branch_3x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/CHANGES.txt?rev=1063706&r1=1063705&r2=1063706&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/solr/CHANGES.txt Wed Jan 26 13:06:40 2011
@@ -575,6 +575,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
 ----------------------

Modified: lucene/dev/branches/branch_3x/solr/src/test-files/solr/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/test-files/solr/conf/schema.xml?rev=1063706&r1=1063705&r2=1063706&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/test-files/solr/conf/schema.xml (original)
+++ lucene/dev/branches/branch_3x/solr/src/test-files/solr/conf/schema.xml Wed Jan 26 13:06:40
2011
@@ -482,6 +482,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"/>
 

Modified: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/highlight/HighlighterTest.java?rev=1063706&r1=1063705&r2=1063706&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/highlight/HighlighterTest.java
(original)
+++ lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/highlight/HighlighterTest.java
Wed Jan 26 13:06:40 2011
@@ -768,4 +768,30 @@ public class HighlighterTest extends Sol
             );
 
   }
+  
+  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'");
+ }
 }



Mime
View raw message