diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index c3fa58bf1c0..8c1147e3d3b 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -261,6 +261,9 @@ Other Changes * SOLR-5590: Upgrade HttpClient/HttpComponents to 4.3.x. (Karl Wright via Shawn Heisey) +* pull request #11: change the default of hl.phraseLimit to 5000. + (Michael Della Bitta via Robert Muir) + ================== 4.6.1 ================== Versions of Major Components diff --git a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java index db2f01fe003..7bd9a07f0e8 100644 --- a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java +++ b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java @@ -399,7 +399,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf params.getBool( HighlightParams.USE_PHRASE_HIGHLIGHTER, true ), // FVH cannot process hl.requireFieldMatch parameter per-field basis params.getBool( HighlightParams.FIELD_MATCH, false ) ); - fvh.setPhraseLimit(params.getInt(HighlightParams.PHRASE_LIMIT, Integer.MAX_VALUE)); + fvh.setPhraseLimit(params.getInt(HighlightParams.PHRASE_LIMIT, SolrHighlighter.DEFAULT_PHRASE_LIMIT)); FieldQuery fieldQuery = fvh.getFieldQuery( query, searcher.getIndexReader() ); // Highlight each document diff --git a/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java b/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java index a68c6d70a5b..1a41af94626 100644 --- a/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java +++ b/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java @@ -34,6 +34,8 @@ import org.apache.solr.util.SolrPluginUtils; public abstract class SolrHighlighter { + + public static int DEFAULT_PHRASE_LIMIT = 5000; public static Logger log = LoggerFactory.getLogger(SolrHighlighter.class); @Deprecated