lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mharw...@apache.org
Subject svn commit: r154447 - in lucene/java/trunk/contrib/highlighter/src: java/org/apache/lucene/search/highlight/Highlighter.java test/org/apache/lucene/search/highlight/HighlighterTest.java
Date Sat, 19 Feb 2005 19:51:05 GMT
Author: mharwood
Date: Sat Feb 19 11:51:04 2005
New Revision: 154447

URL: http://svn.apache.org/viewcvs?view=rev&rev=154447
Log:
Fixed missing fieldname in API

Modified:
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
    lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java?view=diff&r1=154446&r2=154447
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
(original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
Sat Feb 19 11:51:04 2005
@@ -67,13 +67,14 @@
 	 * @param analyzer   the analyzer that will be used to split <code>text</code>
 	 * into chunks  
 	 * @param text text to highlight terms in
+	 * @param fieldName Name of field used to influence analyzer's tokenization policy 
 	 *
 	 * @return highlighted text fragment or null if no terms found
 	 */
-	public final String getBestFragment(Analyzer analyzer, String text)
+	public final String getBestFragment(Analyzer analyzer, String fieldName,String text)
 		throws IOException
 	{
-		TokenStream tokenStream = analyzer.tokenStream("field", new StringReader(text));
+		TokenStream tokenStream = analyzer.tokenStream(fieldName, new StringReader(text));
 		return getBestFragment(tokenStream, text);
 	}
   

Modified: lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?view=diff&r1=154446&r2=154447
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
(original)
+++ lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
Sat Feb 19 11:51:04 2005
@@ -173,7 +173,7 @@
 		for (int i = 0; i < hits.length(); i++)
 		{
     		String text = hits.doc(i).get(FIELD_NAME);
-    		highlighter.getBestFragment(analyzer, text);
+    		highlighter.getBestFragment(analyzer, FIELD_NAME,text);
 		}
 		assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights
== 4);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message