added a filterscannerfail attribute to QueryParams which causes that a

check to the network scanner fail/success status can be used/suppressed
for search results. This is a feature that comes with the port scanner.
pull/1/head
orbiter 12 years ago
parent 7761b60325
commit fe50702eb0

@ -243,7 +243,7 @@ public final class search {
indexSegment, indexSegment,
rankingProfile, rankingProfile,
header.get(RequestHeader.USER_AGENT, ""), header.get(RequestHeader.USER_AGENT, ""),
false, 0.0d, 0.0d, 0.0d false, false, 0.0d, 0.0d, 0.0d
); );
Network.log.logInfo("INIT HASH SEARCH (abstracts only): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links"); Network.log.logInfo("INIT HASH SEARCH (abstracts only): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links");
@ -305,7 +305,7 @@ public final class search {
sb.index, sb.index,
rankingProfile, rankingProfile,
header.get(RequestHeader.USER_AGENT, ""), header.get(RequestHeader.USER_AGENT, ""),
false, 0.0d, 0.0d, 0.0d false, false, 0.0d, 0.0d, 0.0d
); );
Network.log.logInfo("INIT HASH SEARCH (query-" + abstracts + "): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links"); Network.log.logInfo("INIT HASH SEARCH (query-" + abstracts + "): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links");
EventChannel.channels(EventChannel.REMOTESEARCH).addMessage(new RSSMessage("Remote Search Request from " + ((remoteSeed == null) ? "unknown" : remoteSeed.getName()), QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()), "")); EventChannel.channels(EventChannel.REMOTESEARCH).addMessage(new RSSMessage("Remote Search Request from " + ((remoteSeed == null) ? "unknown" : remoteSeed.getName()), QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()), ""));

@ -730,6 +730,7 @@ public class yacysearch {
sb.getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, false) sb.getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, false)
&& sb.getConfigBool(SwitchboardConstants.NETWORK_SEARCHVERIFY, false) && sb.getConfigBool(SwitchboardConstants.NETWORK_SEARCHVERIFY, false)
&& sb.peers.mySeed().getFlagAcceptRemoteIndex(), && sb.peers.mySeed().getFlagAcceptRemoteIndex(),
false,
lat, lon, rad); lat, lon, rad);
EventTracker.delete(EventTracker.EClass.SEARCH); EventTracker.delete(EventTracker.EClass.SEARCH);
EventTracker.update(EventTracker.EClass.SEARCH, new ProfilingGraph.EventSearch( EventTracker.update(EventTracker.EClass.SEARCH, new ProfilingGraph.EventSearch(

@ -141,7 +141,7 @@ public final class QueryParams {
public int transmitcount; // number of results that had been shown to the user public int transmitcount; // number of results that had been shown to the user
public long searchtime, urlretrievaltime, snippetcomputationtime; // time to perform the search, to get all the urls, and to compute the snippets public long searchtime, urlretrievaltime, snippetcomputationtime; // time to perform the search, to get all the urls, and to compute the snippets
public final String userAgent; public final String userAgent;
protected boolean filterfailurls; protected boolean filterfailurls, filterscannerfail;
protected double lat, lon, radius; protected double lat, lon, radius;
public List<String> facetfields; public List<String> facetfields;
public int maxfacets; public int maxfacets;
@ -196,6 +196,7 @@ public final class QueryParams {
this.userAgent = userAgent; this.userAgent = userAgent;
this.transmitcount = 0; this.transmitcount = 0;
this.filterfailurls = false; this.filterfailurls = false;
this.filterscannerfail = false;
this.lat = 0.0d; this.lat = 0.0d;
this.lon = 0.0d; this.lon = 0.0d;
this.radius = 0.0d; this.radius = 0.0d;
@ -234,6 +235,7 @@ public final class QueryParams {
final RankingProfile ranking, final RankingProfile ranking,
final String userAgent, final String userAgent,
final boolean filterfailurls, final boolean filterfailurls,
final boolean filterscannerfail,
final double lat, final double lon, final double radius) { final double lat, final double lon, final double radius) {
this.queryGoal = queryGoal; this.queryGoal = queryGoal;
this.modifier = new Modifier(modifier == null ? "" : modifier); this.modifier = new Modifier(modifier == null ? "" : modifier);
@ -292,6 +294,7 @@ public final class QueryParams {
this.userAgent = userAgent; this.userAgent = userAgent;
this.transmitcount = 0; this.transmitcount = 0;
this.filterfailurls = filterfailurls; this.filterfailurls = filterfailurls;
this.filterscannerfail = filterscannerfail;
// we normalize here the location and radius because that should cause a better caching // we normalize here the location and radius because that should cause a better caching
// and as surplus it will increase privacy // and as surplus it will increase privacy
this.lat = Math.floor(lat * this.kmNormal) / this.kmNormal; this.lat = Math.floor(lat * this.kmNormal) / this.kmNormal;

@ -834,7 +834,7 @@ public final class SearchEvent {
} }
// check Scanner // check Scanner
if ( !Scanner.acceptURL(page.url()) ) { if (this.query.filterscannerfail && !Scanner.acceptURL(page.url())) {
this.query.misses.add(page.hash()); this.query.misses.add(page.hash());
continue; continue;
} }

Loading…
Cancel
Save