mirror of https://github.com/apache/lucene.git
SOLR-6692: Highlighter NPE bugfix when highlight nonexistent field.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1673281 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0c32d78135
commit
f295b3a890
|
@ -237,7 +237,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
|
||||||
* @param params The params controlling Highlighting
|
* @param params The params controlling Highlighting
|
||||||
*/
|
*/
|
||||||
protected int getMaxSnippets(String fieldName, SolrParams params) {
|
protected int getMaxSnippets(String fieldName, SolrParams params) {
|
||||||
return params.getFieldInt(fieldName, HighlightParams.SNIPPETS,1);
|
return params.getFieldInt(fieldName, HighlightParams.SNIPPETS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -298,7 +298,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
|
||||||
protected Fragmenter getFragmenter(String fieldName, SolrParams params)
|
protected Fragmenter getFragmenter(String fieldName, SolrParams params)
|
||||||
{
|
{
|
||||||
String fmt = params.getFieldParam( fieldName, HighlightParams.FRAGMENTER );
|
String fmt = params.getFieldParam( fieldName, HighlightParams.FRAGMENTER );
|
||||||
SolrFragmenter frag = fragmenters.get( fmt );
|
SolrFragmenter frag = fragmenters.get(fmt);
|
||||||
if( frag == null ) {
|
if( frag == null ) {
|
||||||
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Unknown fragmenter: "+fmt );
|
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Unknown fragmenter: "+fmt );
|
||||||
}
|
}
|
||||||
|
@ -450,7 +450,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
|
||||||
|
|
||||||
final int mvToExamine =
|
final int mvToExamine =
|
||||||
req.getParams().getFieldInt(fieldName, HighlightParams.MAX_MULTIVALUED_TO_EXAMINE,
|
req.getParams().getFieldInt(fieldName, HighlightParams.MAX_MULTIVALUED_TO_EXAMINE,
|
||||||
schemaField.multiValued() ? Integer.MAX_VALUE : 1);
|
(schemaField != null && schemaField.multiValued()) ? Integer.MAX_VALUE : 1);
|
||||||
// Technically this is the max *fragments* (snippets), not max values:
|
// Technically this is the max *fragments* (snippets), not max values:
|
||||||
int mvToMatch =
|
int mvToMatch =
|
||||||
req.getParams().getFieldInt(fieldName, HighlightParams.MAX_MULTIVALUED_TO_MATCH, Integer.MAX_VALUE);
|
req.getParams().getFieldInt(fieldName, HighlightParams.MAX_MULTIVALUED_TO_MATCH, Integer.MAX_VALUE);
|
||||||
|
|
Loading…
Reference in New Issue