SOLR-788: set mlt.count back to 5

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1427218 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-12-31 18:42:14 +00:00
parent 69383cb079
commit 5feeb36d46
2 changed files with 12 additions and 9 deletions

View File

@ -75,7 +75,7 @@ public class MoreLikeThisComponent extends SearchComponent {
+ params.getBool(ShardParams.IS_SHARD));
SolrIndexSearcher searcher = rb.req.getSearcher();
int mltcount = params.getInt(MoreLikeThisParams.DOC_COUNT, 20);
int mltcount = params.getInt(MoreLikeThisParams.DOC_COUNT, 5);
if (params.getBool(ShardParams.IS_SHARD, false)) {
if (params.get(MoreLikeThisComponent.DIST_DOC_ID) == null) {
if (rb.getResults().docList.size() == 0) {
@ -156,7 +156,7 @@ public class MoreLikeThisComponent extends SearchComponent {
&& rb.req.getParams().getBool(COMPONENT_NAME, false)) {
Map<Object,SolrDocumentList> tempResults = new LinkedHashMap<Object,SolrDocumentList>();
int mltcount = rb.req.getParams().getInt(MoreLikeThisParams.DOC_COUNT, 20);
int mltcount = rb.req.getParams().getInt(MoreLikeThisParams.DOC_COUNT, 5);
String keyName = rb.req.getSchema().getUniqueKeyField().getName();
for (ShardRequest sreq : rb.finished) {
@ -298,7 +298,7 @@ public class MoreLikeThisComponent extends SearchComponent {
// needed to correlate results
s.params.set(MoreLikeThisComponent.DIST_DOC_ID, key);
s.params.set(CommonParams.START, 0);
int mltcount = s.params.getInt(MoreLikeThisParams.DOC_COUNT, 20);
int mltcount = s.params.getInt(MoreLikeThisParams.DOC_COUNT, 20); // overrequest
s.params.set(CommonParams.ROWS, mltcount);
// adding score to rank moreLikeThis
@ -352,7 +352,7 @@ public class MoreLikeThisComponent extends SearchComponent {
while (iterator.hasNext()) {
int id = iterator.nextDoc();
int rows = p.getInt(MoreLikeThisParams.DOC_COUNT, 20);
int rows = p.getInt(MoreLikeThisParams.DOC_COUNT, 5);
DocListAndSet sim = mltHelper.getMoreLikeThis(id, 0, rows, null, null,
flags);
String name = schema.printableUniqueKey(searcher.doc(id));

View File

@ -31,7 +31,7 @@ import org.junit.Ignore;
* @see org.apache.solr.handler.component.MoreLikeThisComponent
*/
@Slow
@Ignore("distrib mlt not working right")
@Ignore("fails on freebsd")
public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
private String requestHandlerName;
@ -122,24 +122,27 @@ public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
// per shard - because of this, depending on params, distrib and single
// shard queries will not match.
// because distrib and single node do not currently sort exactly the same,
// we ask for an mlt.count of 20 to ensure both include all results
query("q", "lowerfilt:moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 2,
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName);
requestHandlerName, "mlt.count", "20");
query("q", "lowerfilt:fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName);
requestHandlerName, "mlt.count", "20");
query("q", "lowerfilt:the red fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName);
requestHandlerName, "mlt.count", "20");
query("q", "lowerfilt:blue moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName);
requestHandlerName, "mlt.count", "20");
}
}