SOLR-9546: remove unnecessary boxing

This commit is contained in:
Noble Paul 2016-11-29 18:02:59 +05:30
parent 32c4bd7cc0
commit 70b358960d
1 changed files with 6 additions and 13 deletions

View File

@ -69,26 +69,19 @@ public class CloudMLTQParser extends QParser {
Map<String,Float> boostFields = new HashMap<>();
MoreLikeThis mlt = new MoreLikeThis(req.getSearcher().getIndexReader());
if(localParams.getInt("mintf") != null)
mlt.setMinTermFreq(localParams.getInt("mintf"));
mlt.setMinTermFreq(localParams.getInt("mintf", MoreLikeThis.DEFAULT_MIN_TERM_FREQ));
mlt.setMinDocFreq(localParams.getInt("mindf", 0));
if(localParams.get("minwl") != null)
mlt.setMinWordLen(localParams.getInt("minwl"));
mlt.setMinWordLen(localParams.getInt("minwl", MoreLikeThis.DEFAULT_MIN_WORD_LENGTH));
if(localParams.get("maxwl") != null)
mlt.setMaxWordLen(localParams.getInt("maxwl"));
mlt.setMaxWordLen(localParams.getInt("maxwl", MoreLikeThis.DEFAULT_MAX_WORD_LENGTH));
if(localParams.get("maxqt") != null)
mlt.setMaxQueryTerms(localParams.getInt("maxqt"));
mlt.setMaxQueryTerms(localParams.getInt("maxqt", MoreLikeThis.DEFAULT_MAX_QUERY_TERMS));
if(localParams.get("maxntp") != null)
mlt.setMaxNumTokensParsed(localParams.getInt("maxntp"));
mlt.setMaxNumTokensParsed(localParams.getInt("maxntp", MoreLikeThis.DEFAULT_MAX_NUM_TOKENS_PARSED));
if(localParams.get("maxdf") != null) {
mlt.setMaxDocFreq(localParams.getInt("maxdf"));
}
mlt.setMaxDocFreq(localParams.getInt("maxdf", MoreLikeThis.DEFAULT_MAX_DOC_FREQ));
if(localParams.get("boost") != null) {
mlt.setBoost(localParams.getBool("boost"));