SOLR-1319: Upgrade Solr Highlighter classes to new Lucene Highlighter API

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@821555 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-10-04 16:24:39 +00:00
parent 67b09bd627
commit 2a6f6f14d3
3 changed files with 6 additions and 12 deletions

View File

@ -731,6 +731,11 @@ Other Changes
48. SOLR-1423: Due to LUCENE-1906, Solr's tokenizer should use Tokenizer.correctOffset() instead of CharStream.correctOffset(). 48. SOLR-1423: Due to LUCENE-1906, Solr's tokenizer should use Tokenizer.correctOffset() instead of CharStream.correctOffset().
(Uwe Schindler via koji) (Uwe Schindler via koji)
49. SOLR-1319, SOLR-1345: Upgrade Solr Highlighter classes to new Lucene Highlighter API. This upgrade has
resulted in a back compat break in the DefaultSolrHighlighter class - getQueryScorer is no longer
protected. If you happened to be overriding that method in custom code, overide getHighlighter instead.
Also, HighlightingUtils#getQueryScorer has been removed as it was deprecated and backcompat has been
broken with it anyway. (Mark Miller)
Build Build
---------------------- ----------------------

View File

@ -165,7 +165,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
* @param fieldName The name of the field * @param fieldName The name of the field
* @param request The SolrQueryRequest * @param request The SolrQueryRequest
*/ */
protected QueryTermScorer getQueryScorer(Query query, String fieldName, SolrQueryRequest request) { private Scorer getQueryScorer(Query query, String fieldName, SolrQueryRequest request) {
boolean reqFieldMatch = request.getParams().getFieldBool(fieldName, HighlightParams.FIELD_MATCH, false); boolean reqFieldMatch = request.getParams().getFieldBool(fieldName, HighlightParams.FIELD_MATCH, false);
if (reqFieldMatch) { if (reqFieldMatch) {
return new QueryTermScorer(query, request.getSearcher().getReader(), fieldName); return new QueryTermScorer(query, request.getSearcher().getReader(), fieldName);

View File

@ -88,14 +88,6 @@ public class HighlightingUtils implements HighlightParams {
return HIGHLIGHTER.getHighlighterX(query, fieldName, request); return HIGHLIGHTER.getHighlighterX(query, fieldName, request);
} }
/**
* @deprecated use DefaultSolrHighlighter
* @see DefaultSolrHighlighter
*/
public static QueryTermScorer getQueryScorer(Query query, String fieldName, SolrQueryRequest request) {
return HIGHLIGHTER.getQueryScorerX(query, fieldName, request);
}
/** /**
* @deprecated use DefaultSolrHighlighter * @deprecated use DefaultSolrHighlighter
* @see DefaultSolrHighlighter#getHighlightFields * @see DefaultSolrHighlighter#getHighlightFields
@ -145,9 +137,6 @@ class SolrHighlighterX extends DefaultSolrHighlighter {
Highlighter getHighlighterX(Query query, String fieldName, SolrQueryRequest request) { Highlighter getHighlighterX(Query query, String fieldName, SolrQueryRequest request) {
return getHighlighter(query, fieldName, request); return getHighlighter(query, fieldName, request);
} }
QueryTermScorer getQueryScorerX(Query query, String fieldName, SolrQueryRequest request) {
return getQueryScorer(query, fieldName, request);
}
int getMaxSnippetsX(String fieldName, SolrQueryRequest request) { int getMaxSnippetsX(String fieldName, SolrQueryRequest request) {
return getMaxSnippets(fieldName, HighlightingUtils.getParams(request)); return getMaxSnippets(fieldName, HighlightingUtils.getParams(request));
} }