lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsmi...@apache.org
Subject svn commit: r1673281 - /lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
Date Mon, 13 Apr 2015 21:11:41 GMT
Author: dsmiley
Date: Mon Apr 13 21:11:40 2015
New Revision: 1673281

URL: http://svn.apache.org/r1673281
Log:
SOLR-6692: Highlighter NPE bugfix when highlight nonexistent field.

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java?rev=1673281&r1=1673280&r2=1673281&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
Mon Apr 13 21:11:40 2015
@@ -237,7 +237,7 @@ public class DefaultSolrHighlighter exte
    * @param params The params controlling Highlighting
    */
   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 exte
   protected Fragmenter getFragmenter(String fieldName, SolrParams params)
   {
     String fmt = params.getFieldParam( fieldName, HighlightParams.FRAGMENTER );
-    SolrFragmenter frag = fragmenters.get( fmt );
+    SolrFragmenter frag = fragmenters.get(fmt);
     if( frag == null ) {
       throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Unknown fragmenter:
"+fmt );
     }
@@ -450,7 +450,7 @@ public class DefaultSolrHighlighter exte
 
     final int mvToExamine =
         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:
     int mvToMatch =
         req.getParams().getFieldInt(fieldName, HighlightParams.MAX_MULTIVALUED_TO_MATCH,
Integer.MAX_VALUE);



Mime
View raw message