Skip to content

Commit

Permalink
perform greedy learning heuristic only if load < 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Orbiter committed Dec 4, 2013
1 parent 81926c0 commit da38034
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions htroot/yacysearchitem.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.net.MalformedURLException;
import java.util.Iterator;

import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.analysis.Classification;
import net.yacy.cora.document.analysis.Classification.ContentDomain;
Expand All @@ -39,6 +40,7 @@
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.RequestHeader.FileType;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.Memory;
import net.yacy.crawler.data.Cache;
import net.yacy.data.URLLicense;
import net.yacy.kelondro.util.Formatter;
Expand Down Expand Up @@ -261,8 +263,8 @@ public static serverObjects respond(final RequestHeader header, final serverObje
boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted;
boolean stealthmode = p2pmode && theSearch.query.isLocal();
if ((sb.getConfigBool(SwitchboardConstants.HEURISTIC_SEARCHRESULTS, false) ||
(sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ACTIVE, false) && sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ENABLED, false))) &&
!stealthmode) sb.heuristicSearchResults(resultUrlstring);
(sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ACTIVE, false) && sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ENABLED, false) && Memory.load() < 1.0)) &&
!stealthmode) sb.heuristicSearchResults(resultUrlstring);
theSearch.query.transmitcount = item + 1;
return prop;
}
Expand Down

0 comments on commit da38034

Please sign in to comment.