lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1448863 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/test/org/apache/solr/search/TestSurroundQueryParser.java
Date Fri, 22 Feb 2013 00:05:59 GMT
Author: hossman
Date: Fri Feb 22 00:05:58 2013
New Revision: 1448863

URL: http://svn.apache.org/r1448863
Log:
SOLR-3060: SurroundQParserPlugin highlighting tests

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1448863&r1=1448862&r2=1448863&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Fri Feb 22 00:05:58 2013
@@ -181,6 +181,8 @@ Other Changes
 * SOLR-4394: Tests and example configs demonstrating SSL with both server 
   and client certs (hossman)
 
+* SOLR-3060: SurroundQParserPlugin highlighting tests 
+  (Ahmet Arslan via hossman)
 
 ==================  4.1.0 ==================
 

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java?rev=1448863&r1=1448862&r2=1448863&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java
Fri Feb 22 00:05:58 2013
@@ -1,4 +1,3 @@
-
 package org.apache.solr.search;
 
 /*
@@ -45,7 +44,7 @@ public class TestSurroundQueryParser ext
   
   public void testQueryParser() {
     String v = "a b c d e a b c f g h i j k l m l k j z z z";
-    assertU(adoc("id","1", "text",v,  "text_np",v));
+    assertU(adoc("id","1", "text",v,  "text_np",v, "name",v));
     
     v="abc abxy cde efg ef e  ";
     assertU(adoc("id","2", "text",v,  "text_np",v));
@@ -84,6 +83,26 @@ public class TestSurroundQueryParser ext
     t1 = localP + "(1003 2n 1001) 3N 1006";
     assertQ(req("q", t1, "indent","true")
         ,"//*[@numFound='1']");
+
+    // test highlighted response with ordered query and hl.usePhraseHighlighter=true
+    assertQ(req("q", "{!surround df=name}k w l", 
+                "hl", "true", 
+                "hl.fl", "name", 
+                "hl.usePhraseHighlighter", "true")
+        ,"//*[@numFound='1']"
+        ,"//lst[@name='highlighting']/lst[@name='1']"
+        ,"//lst[@name='1']/arr[@name='name']/str[.='a b c d e a b c f g h i j <em>k</em>
<em>l</em> m l k j z z z']");
+
+    // test highlighted response with ordered query and hl.usePhraseHighlighter=false
+    assertQ(req("q", "{!surround df=name}k w l", 
+                "hl", "true", 
+                "hl.fl", "name", 
+                "hl.usePhraseHighlighter", "false")
+        ,"//*[@numFound='1']"
+        ,"//lst[@name='highlighting']/lst[@name='1']"
+        ,"//lst[@name='1']/arr[@name='name']/str[.='a b c d e a b c f g h i j <em>k</em>
<em>l</em> m <em>l</em> <em>k</em> j z z z']");
   }
+
+
   
 }



Mime
View raw message