SOLR-10849: MoreLikeThisComponent should expose setMaxDocFreqPct (maxDoc frequency percentage).

This commit is contained in:
Dawid Weiss 2017-06-12 11:48:21 +02:00
parent 661a3c46d4
commit b2ea95c9ec
3 changed files with 11 additions and 0 deletions

View File

@ -284,6 +284,9 @@ Upgrade Notes
New Features
----------------------
* SOLR-10849: MoreLikeThisComponent should expose setMaxDocFreqPct (maxDoc
frequency percentage). (Dawid Weiss)
* SOLR-10307: Allow Passing SSL passwords through environment variables. (Mano Kovacs via Mark Miller)
* SOLR-10721: Provide a way to know when Core Discovery is finished and when all async cores are done loading

View File

@ -335,6 +335,13 @@ public class MoreLikeThisHandler extends RequestHandlerBase
mlt.setMaxQueryTerms( params.getInt(MoreLikeThisParams.MAX_QUERY_TERMS, MoreLikeThis.DEFAULT_MAX_QUERY_TERMS));
mlt.setMaxNumTokensParsed(params.getInt(MoreLikeThisParams.MAX_NUM_TOKENS_PARSED, MoreLikeThis.DEFAULT_MAX_NUM_TOKENS_PARSED));
mlt.setBoost( params.getBool(MoreLikeThisParams.BOOST, false ) );
// There is no default for maxDocFreqPct. Also, it's a bit oddly expressed as an integer value
// (percentage of the collection's documents count). We keep Lucene's convention here.
if (params.getInt(MoreLikeThisParams.MAX_DOC_FREQ_PCT) != null) {
mlt.setMaxDocFreqPct(params.getInt(MoreLikeThisParams.MAX_DOC_FREQ_PCT));
}
boostFields = SolrPluginUtils.parseFieldBoosts(params.getParams(MoreLikeThisParams.QF));
}

View File

@ -31,6 +31,7 @@ public interface MoreLikeThisParams
public final static String SIMILARITY_FIELDS = PREFIX + "fl";
public final static String MIN_TERM_FREQ = PREFIX + "mintf";
public final static String MAX_DOC_FREQ = PREFIX + "maxdf";
public final static String MAX_DOC_FREQ_PCT = PREFIX + "maxdfpct";
public final static String MIN_DOC_FREQ = PREFIX + "mindf";
public final static String MIN_WORD_LEN = PREFIX + "minwl";
public final static String MAX_WORD_LEN = PREFIX + "maxwl";