mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-07-18 08:36:07 -04:00
fix for solr/gsa result logging
This commit is contained in:
htroot
@ -41,6 +41,7 @@ import net.yacy.search.schema.CollectionSchema;
|
||||
import net.yacy.server.serverObjects;
|
||||
import net.yacy.server.serverSwitch;
|
||||
|
||||
import org.apache.solr.common.SolrDocumentList;
|
||||
import org.apache.solr.common.SolrException;
|
||||
import org.apache.solr.common.params.CommonParams;
|
||||
import org.apache.solr.request.SolrQueryRequest;
|
||||
@ -220,9 +221,15 @@ public class searchresult {
|
||||
|
||||
// log result
|
||||
Object rv = response.getValues().get("response");
|
||||
int matches = 0;
|
||||
if (rv != null && rv instanceof ResultContext) {
|
||||
AccessTracker.addToDump(originalQuery, Integer.toString(((ResultContext) rv).docs.matches()));
|
||||
matches = ((ResultContext) rv).docs.matches();
|
||||
} else if (rv != null && rv instanceof SolrDocumentList) {
|
||||
matches = (int) ((SolrDocumentList) rv).getNumFound();
|
||||
}
|
||||
AccessTracker.addToDump(originalQuery, Integer.toString(matches));
|
||||
ConcurrentLog.info("GSA Query", "results: " + matches + ", for query:" + post.toString());
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ import net.yacy.search.schema.WebgraphSchema;
|
||||
import net.yacy.server.serverObjects;
|
||||
import net.yacy.server.serverSwitch;
|
||||
|
||||
import org.apache.solr.common.SolrDocumentList;
|
||||
import org.apache.solr.common.SolrException;
|
||||
import org.apache.solr.common.params.CommonParams;
|
||||
import org.apache.solr.common.params.SolrParams;
|
||||
@ -252,11 +253,14 @@ public class select {
|
||||
|
||||
// log result
|
||||
Object rv = response.getValues().get("response");
|
||||
int matches = 0;
|
||||
if (rv != null && rv instanceof ResultContext) {
|
||||
int matches = ((ResultContext) rv).docs.matches();
|
||||
AccessTracker.addToDump(q, Integer.toString(matches));
|
||||
ConcurrentLog.info("SOLR Query", "results: " + matches + ", for query:" + post.toString());
|
||||
matches = ((ResultContext) rv).docs.matches();
|
||||
} else if (rv != null && rv instanceof SolrDocumentList) {
|
||||
matches = (int) ((SolrDocumentList) rv).getNumFound();
|
||||
}
|
||||
AccessTracker.addToDump(q, Integer.toString(matches));
|
||||
ConcurrentLog.info("SOLR Query", "results: " + matches + ", for query:" + post.toString());
|
||||
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user