avoid division by zero if search is done for no words

this case is relevant if the bluewords (yacy.blue) are used

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3698 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 2fa8b50e54
commit 26f05d1fd0

@ -229,7 +229,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
// load a transformer // load a transformer
transformer = new htmlFilterContentTransformer(); transformer = new htmlFilterContentTransformer();
transformer.init(new File(switchboard.getRootPath(), switchboard.getConfig("plasmaBlueList", "")).toString()); transformer.init(new File(switchboard.getRootPath(), switchboard.getConfig(plasmaSwitchboard.LIST_BLUE, "")).toString());
String f; String f;
// load the yellow-list // load the yellow-list

@ -339,7 +339,7 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
// retrieve entities that belong to the hashes // retrieve entities that belong to the hashes
profileLocal.startTimer(); profileLocal.startTimer();
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Map inclusionContainers = wordIndex.getContainers( Map inclusionContainers = (query.queryHashes.size() == 0) ? new HashMap() : wordIndex.getContainers(
query.queryHashes, query.queryHashes,
urlselection, urlselection,
true, true,
@ -369,6 +369,7 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
profileLocal.startTimer(); profileLocal.startTimer();
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
indexContainer rcLocal = indexContainer.joinContainers(includeContainers, indexContainer rcLocal = indexContainer.joinContainers(includeContainers,
(query.queryHashes.size() == 0) ? 0 :
profileLocal.getTargetTime(plasmaSearchTimingProfile.PROCESS_JOIN) * query.queryHashes.size() / (query.queryHashes.size() + query.excludeHashes.size()), profileLocal.getTargetTime(plasmaSearchTimingProfile.PROCESS_JOIN) * query.queryHashes.size() / (query.queryHashes.size() + query.excludeHashes.size()),
query.maxDistance); query.maxDistance);
long remaining = profileLocal.getTargetTime(plasmaSearchTimingProfile.PROCESS_JOIN) - System.currentTimeMillis() + start; long remaining = profileLocal.getTargetTime(plasmaSearchTimingProfile.PROCESS_JOIN) - System.currentTimeMillis() + start;

Loading…
Cancel
Save