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

solr 4.0.0 migration)
pull/1/head
Michael Peter Christen 13 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.SolrException;
import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.CommonParams;
import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.ResultContext;
import org.apache.solr.response.SolrQueryResponse; import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.search.DocSlice;
import org.apache.solr.util.FastWriter; import org.apache.solr.util.FastWriter;
@ -189,8 +189,8 @@ public class searchresult {
// log result // log result
Object rv = response.getValues().get("response"); Object rv = response.getValues().get("response");
if (rv != null && rv instanceof DocSlice) { if (rv != null && rv instanceof ResultContext) {
AccessTracker.addToDump(q, Integer.toString(((DocSlice) rv).matches())); AccessTracker.addToDump(q, Integer.toString(((ResultContext) rv).docs.matches()));
} }
return null; return null;
} }

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

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

@ -49,7 +49,7 @@ import org.apache.solr.common.params.ModifiableSolrParams;
public abstract class SolrServerConnector extends AbstractSolrConnector implements SolrConnector { 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 SolrServer server;
protected int commitWithinMs; // max time (in ms) before a commit will happen protected int commitWithinMs; // max time (in ms) before a commit will happen

Loading…
Cancel
Save