From 672eeff8d2aaae093f2f4a3060a483a55cf833b4 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Wed, 28 Nov 2012 17:53:06 +0000 Subject: [PATCH] SOLR-4087: Add MAX_DOC_FREQ option to MoreLikeThis. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1414841 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ .../src/java/org/apache/solr/handler/MoreLikeThisHandler.java | 2 ++ .../java/org/apache/solr/common/params/MoreLikeThisParams.java | 1 + 3 files changed, 6 insertions(+) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index ae17a5c3d95..397982ef4dd 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -103,6 +103,9 @@ New Features Example: foo AND {!term f=myfield v=$qq} (yonik) +* SOLR-4087: Add MAX_DOC_FREQ option to MoreLikeThis. + (Andrew Janowczyk via Mark Miller) + Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java b/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java index 62a406ae847..911d4dee684 100644 --- a/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java @@ -298,8 +298,10 @@ public class MoreLikeThisHandler extends RequestHandlerBase mlt.setAnalyzer( searcher.getSchema().getAnalyzer() ); // configurable params + mlt.setMinTermFreq( params.getInt(MoreLikeThisParams.MIN_TERM_FREQ, MoreLikeThis.DEFAULT_MIN_TERM_FREQ)); mlt.setMinDocFreq( params.getInt(MoreLikeThisParams.MIN_DOC_FREQ, MoreLikeThis.DEFAULT_MIN_DOC_FREQ)); + mlt.setMaxDocFreq( params.getInt(MoreLikeThisParams.MAX_DOC_FREQ, MoreLikeThis.DEFAULT_MAX_DOC_FREQ)); mlt.setMinWordLen( params.getInt(MoreLikeThisParams.MIN_WORD_LEN, MoreLikeThis.DEFAULT_MIN_WORD_LENGTH)); mlt.setMaxWordLen( params.getInt(MoreLikeThisParams.MAX_WORD_LEN, MoreLikeThis.DEFAULT_MAX_WORD_LENGTH)); mlt.setMaxQueryTerms( params.getInt(MoreLikeThisParams.MAX_QUERY_TERMS, MoreLikeThis.DEFAULT_MAX_QUERY_TERMS)); diff --git a/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java b/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java index ea56fd717b0..0d808c2503f 100644 --- a/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java +++ b/solr/solrj/src/java/org/apache/solr/common/params/MoreLikeThisParams.java @@ -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 MIN_DOC_FREQ = PREFIX + "mindf"; public final static String MIN_WORD_LEN = PREFIX + "minwl"; public final static String MAX_WORD_LEN = PREFIX + "maxwl";