mirror of
https://github.com/apache/lucene.git
synced 2025-02-23 02:35:02 +00:00
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:
parent
69383cb079
commit
5feeb36d46
@ -75,7 +75,7 @@ public class MoreLikeThisComponent extends SearchComponent {
|
|||||||
+ params.getBool(ShardParams.IS_SHARD));
|
+ params.getBool(ShardParams.IS_SHARD));
|
||||||
SolrIndexSearcher searcher = rb.req.getSearcher();
|
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.getBool(ShardParams.IS_SHARD, false)) {
|
||||||
if (params.get(MoreLikeThisComponent.DIST_DOC_ID) == null) {
|
if (params.get(MoreLikeThisComponent.DIST_DOC_ID) == null) {
|
||||||
if (rb.getResults().docList.size() == 0) {
|
if (rb.getResults().docList.size() == 0) {
|
||||||
@ -156,7 +156,7 @@ public class MoreLikeThisComponent extends SearchComponent {
|
|||||||
&& rb.req.getParams().getBool(COMPONENT_NAME, false)) {
|
&& rb.req.getParams().getBool(COMPONENT_NAME, false)) {
|
||||||
Map<Object,SolrDocumentList> tempResults = new LinkedHashMap<Object,SolrDocumentList>();
|
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();
|
String keyName = rb.req.getSchema().getUniqueKeyField().getName();
|
||||||
|
|
||||||
for (ShardRequest sreq : rb.finished) {
|
for (ShardRequest sreq : rb.finished) {
|
||||||
@ -298,7 +298,7 @@ public class MoreLikeThisComponent extends SearchComponent {
|
|||||||
// needed to correlate results
|
// needed to correlate results
|
||||||
s.params.set(MoreLikeThisComponent.DIST_DOC_ID, key);
|
s.params.set(MoreLikeThisComponent.DIST_DOC_ID, key);
|
||||||
s.params.set(CommonParams.START, 0);
|
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);
|
s.params.set(CommonParams.ROWS, mltcount);
|
||||||
|
|
||||||
// adding score to rank moreLikeThis
|
// adding score to rank moreLikeThis
|
||||||
@ -352,7 +352,7 @@ public class MoreLikeThisComponent extends SearchComponent {
|
|||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
int id = iterator.nextDoc();
|
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,
|
DocListAndSet sim = mltHelper.getMoreLikeThis(id, 0, rows, null, null,
|
||||||
flags);
|
flags);
|
||||||
String name = schema.printableUniqueKey(searcher.doc(id));
|
String name = schema.printableUniqueKey(searcher.doc(id));
|
||||||
|
@ -31,7 +31,7 @@ import org.junit.Ignore;
|
|||||||
* @see org.apache.solr.handler.component.MoreLikeThisComponent
|
* @see org.apache.solr.handler.component.MoreLikeThisComponent
|
||||||
*/
|
*/
|
||||||
@Slow
|
@Slow
|
||||||
@Ignore("distrib mlt not working right")
|
@Ignore("fails on freebsd")
|
||||||
public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
|
public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
|
||||||
|
|
||||||
private String requestHandlerName;
|
private String requestHandlerName;
|
||||||
@ -122,24 +122,27 @@ public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
|
|||||||
// per shard - because of this, depending on params, distrib and single
|
// per shard - because of this, depending on params, distrib and single
|
||||||
// shard queries will not match.
|
// 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,
|
query("q", "lowerfilt:moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 2,
|
||||||
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
|
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
|
||||||
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
|
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
|
||||||
requestHandlerName);
|
requestHandlerName, "mlt.count", "20");
|
||||||
|
|
||||||
query("q", "lowerfilt:fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
|
query("q", "lowerfilt:fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
|
||||||
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
|
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
|
||||||
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
|
"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,
|
query("q", "lowerfilt:the red fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
|
||||||
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
|
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
|
||||||
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
|
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
|
||||||
requestHandlerName);
|
requestHandlerName, "mlt.count", "20");
|
||||||
|
|
||||||
query("q", "lowerfilt:blue moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
|
query("q", "lowerfilt:blue moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
|
||||||
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
|
MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
|
||||||
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
|
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
|
||||||
requestHandlerName);
|
requestHandlerName, "mlt.count", "20");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user