Author: ab Date: Wed Nov 25 21:17:10 2009 New Revision: 884277 URL: http://svn.apache.org/viewvc?rev=884277&view=rev Log: NUTCH-772 Upgrade Nutch to use Lucene 2.9.1.
Added: lucene/nutch/trunk/lib/lucene-core-2.9.1.jar (with props) lucene/nutch/trunk/lib/lucene-misc-2.9.1.jar (with props) lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/lib/lucene-analyzers-2.9.1.jar (with props) lucene/nutch/trunk/src/plugin/summary-lucene/lib/lucene-highlighter-2.9.1.jar (with props) Removed: lucene/nutch/trunk/lib/lucene-core-2.4.0.jar lucene/nutch/trunk/lib/lucene-misc-2.4.0.jar lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/lib/lucene-analyzers-2.4.0.jar lucene/nutch/trunk/src/plugin/summary-lucene/lib/lucene-highlighter-2.4.0.jar Modified: lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/plugin.xml lucene/nutch/trunk/src/plugin/summary-lucene/plugin.xml lucene/nutch/trunk/src/plugin/summary-lucene/src/java/org/apache/nutch/summary/lucene/LuceneSummarizer.java Added: lucene/nutch/trunk/lib/lucene-core-2.9.1.jar URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/lib/lucene-core-2.9.1.jar?rev=884277&view=auto ============================================================================== Binary file - no diff available. Propchange: lucene/nutch/trunk/lib/lucene-core-2.9.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: lucene/nutch/trunk/lib/lucene-misc-2.9.1.jar URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/lib/lucene-misc-2.9.1.jar?rev=884277&view=auto ============================================================================== Binary file - no diff available. Propchange: lucene/nutch/trunk/lib/lucene-misc-2.9.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/lib/lucene-analyzers-2.9.1.jar URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/lib/lucene-analyzers-2.9.1.jar?rev=884277&view=auto ============================================================================== Binary file - no diff available. Propchange: lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/lib/lucene-analyzers-2.9.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/plugin.xml URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/plugin.xml?rev=884277&r1=884276&r2=884277&view=diff ============================================================================== --- lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/plugin.xml (original) +++ lucene/nutch/trunk/src/plugin/lib-lucene-analyzers/plugin.xml Wed Nov 25 21:17:10 2009 @@ -25,11 +25,11 @@ <plugin id="lib-lucene-analyzers" name="Lucene Analysers" - version="2.4.0" + version="2.9.1" provider-name="org.apache.lucene"> <runtime> - <library name="lucene-analyzers-2.4.0.jar"> + <library name="lucene-analyzers-2.9.1.jar"> <export name="*"/> </library> </runtime> Added: lucene/nutch/trunk/src/plugin/summary-lucene/lib/lucene-highlighter-2.9.1.jar URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/summary-lucene/lib/lucene-highlighter-2.9.1.jar?rev=884277&view=auto ============================================================================== Binary file - no diff available. Propchange: lucene/nutch/trunk/src/plugin/summary-lucene/lib/lucene-highlighter-2.9.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: lucene/nutch/trunk/src/plugin/summary-lucene/plugin.xml URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/summary-lucene/plugin.xml?rev=884277&r1=884276&r2=884277&view=diff ============================================================================== --- lucene/nutch/trunk/src/plugin/summary-lucene/plugin.xml (original) +++ lucene/nutch/trunk/src/plugin/summary-lucene/plugin.xml Wed Nov 25 21:17:10 2009 @@ -25,7 +25,7 @@ <library name="summary-lucene.jar"> <export name="*"/> </library> - <library name="lucene-highlighter-2.4.0.jar"/> + <library name="lucene-highlighter-2.9.1.jar"/> </runtime> <requires> Modified: lucene/nutch/trunk/src/plugin/summary-lucene/src/java/org/apache/nutch/summary/lucene/LuceneSummarizer.java URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/summary-lucene/src/java/org/apache/nutch/summary/lucene/LuceneSummarizer.java?rev=884277&r1=884276&r2=884277&view=diff ============================================================================== --- lucene/nutch/trunk/src/plugin/summary-lucene/src/java/org/apache/nutch/summary/lucene/LuceneSummarizer.java (original) +++ lucene/nutch/trunk/src/plugin/summary-lucene/src/java/org/apache/nutch/summary/lucene/LuceneSummarizer.java Wed Nov 25 21:17:10 2009 @@ -30,6 +30,7 @@ import org.apache.lucene.search.highlight.QueryScorer; import org.apache.lucene.search.highlight.SimpleHTMLFormatter; import org.apache.lucene.search.highlight.WeightedTerm; +import org.apache.lucene.search.highlight.WeightedSpanTerm; // Nutch imports import org.apache.nutch.analysis.NutchDocumentAnalyzer; @@ -84,9 +85,9 @@ public Summary getSummary(String text, Query query) { String[] terms = query.getTerms(); - WeightedTerm[] weighted = new WeightedTerm[terms.length]; + WeightedSpanTerm[] weighted = new WeightedSpanTerm[terms.length]; for (int i=0; i<terms.length; i++) { - weighted[i] = new WeightedTerm(1.0f, terms[i]); + weighted[i] = new WeightedSpanTerm(1.0f, terms[i]); } Highlighter highlighter = new Highlighter(FORMATTER, new QueryScorer(weighted)); TokenStream tokens = analyzer.tokenStream("content", new StringReader(text));