update to search result logging (this was a remaining issue from the

solr 4.0.0 migration)
pull/1/head
Michael Peter Christen 12 years ago
parent 570e42c4e3
commit 5105256927

@ -44,8 +44,8 @@ import net.yacy.server.serverSwitch;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.ResultContext;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.search.DocSlice;
import org.apache.solr.util.FastWriter;
@ -189,8 +189,8 @@ public class searchresult {
// log result
Object rv = response.getValues().get("response");
if (rv != null && rv instanceof DocSlice) {
AccessTracker.addToDump(q, Integer.toString(((DocSlice) rv).matches()));
if (rv != null && rv instanceof ResultContext) {
AccessTracker.addToDump(q, Integer.toString(((ResultContext) rv).docs.matches()));
}
return null;
}

@ -51,9 +51,9 @@ import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.QueryResponseWriter;
import org.apache.solr.response.ResultContext;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.response.XSLTResponseWriter;
import org.apache.solr.search.DocSlice;
import org.apache.solr.util.FastWriter;
@ -200,8 +200,8 @@ public class select {
// log result
Object rv = response.getValues().get("response");
if (rv != null && rv instanceof DocSlice) {
AccessTracker.addToDump(q, Integer.toString(((DocSlice) rv).matches()));
if (rv != null && rv instanceof ResultContext) {
AccessTracker.addToDump(q, Integer.toString(((ResultContext) rv).docs.matches()));
}
return null;
}

@ -183,6 +183,7 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
if (q != null) Thread.currentThread().setName("solr query: q = " + q);
QueryResponse rsp = this.server.query(params);
if (q != null) Thread.currentThread().setName(threadname);
if (rsp != null) log.info(rsp.getResults().size() + " results for q=" + q);
return rsp;
} catch (SolrServerException e) {
throw new IOException(e);

@ -49,7 +49,7 @@ import org.apache.solr.common.params.ModifiableSolrParams;
public abstract class SolrServerConnector extends AbstractSolrConnector implements SolrConnector {
private final static Logger log = Logger.getLogger(SolrServerConnector.class);
protected final static Logger log = Logger.getLogger(SolrServerConnector.class);
protected SolrServer server;
protected int commitWithinMs; // max time (in ms) before a commit will happen

Loading…
Cancel
Save