Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixes in connection with transiton to byte[] hashes
orbiter1b8d346b4c60
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex ef241850a..97b026776 100644--- a/htroot/yacysearch.java+++ b/htroot/yacysearch.java@@ -395,7 +395,7 @@ public class yacysearch {theQuery.filterOut(plasmaSwitchboard.blueList);// log- Log.logInfo("LOCAL_SEARCH", "INIT WORD SEARCH: " + theQuery.queryString + ":" + theQuery.queryHashes + " - " + theQuery.neededResults() + " links to be computed, " + theQuery.displayResults() + " lines to be displayed");+ Log.logInfo("LOCAL_SEARCH", "INIT WORD SEARCH: " + theQuery.queryString + ":" + plasmaSearchQuery.hashSet2hashString(theQuery.queryHashes) + " - " + theQuery.neededResults() + " links to be computed, " + theQuery.displayResults() + " lines to be displayed");RSSFeed.channels(RSSFeed.LOCALSEARCH).addMessage(new RSSMessage("Local Search Request", theQuery.queryString, ""));final long timestamp = System.currentTimeMillis();diff --git a/source/de/anomic/kelondro/text/AbstractBufferedIndex.java b/source/de/anomic/kelondro/text/AbstractBufferedIndex.javaindex ec21457df..c57ff19f3 100644--- a/source/de/anomic/kelondro/text/AbstractBufferedIndex.java+++ b/source/de/anomic/kelondro/text/AbstractBufferedIndex.java@@ -39,10 +39,11 @@ public abstract class AbstractBufferedIndex<ReferenceType extends Reference> extsuper(factory);}- public synchronized TreeSet<ReferenceContainer<ReferenceType>> references(final byte[] startHash, final boolean rot, int count, boolean ram) throws IOException {+ public synchronized TreeSet<ReferenceContainer<ReferenceType>> references(byte[] startHash, final boolean rot, int count, boolean ram) throws IOException {// creates a set of indexContainers// this does not use the cachefinal Order<ReferenceContainer<ReferenceType>> containerOrder = new ReferenceContainerOrder<ReferenceType>(factory, this.ordering().clone());+ if (startHash.length == 0) startHash = null;ReferenceContainer<ReferenceType> emptyContainer = ReferenceContainer.emptyContainer(factory, startHash, 0);containerOrder.rotate(emptyContainer);final TreeSet<ReferenceContainer<ReferenceType>> containers = new TreeSet<ReferenceContainer<ReferenceType>>(containerOrder);diff --git a/source/de/anomic/kelondro/text/ReferenceContainerCache.java b/source/de/anomic/kelondro/text/ReferenceContainerCache.javaindex 98d4e560e..17cebfce6 100644--- a/source/de/anomic/kelondro/text/ReferenceContainerCache.java+++ b/source/de/anomic/kelondro/text/ReferenceContainerCache.java@@ -318,8 +318,9 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exteprivate final boolean rot;private Iterator<ReferenceContainer<ReferenceType>> iterator;- public heapCacheIterator(final byte[] startWordHash, final boolean rot) {+ public heapCacheIterator(byte[] startWordHash, final boolean rot) {this.rot = rot;+ if (startWordHash.length == 0) startWordHash = null;this.iterator = (startWordHash == null) ? cache.values().iterator() : cache.tailMap(startWordHash).values().iterator();// The collection's iterator will return the values in the order that their corresponding keys appear in the tree.}diff --git a/source/de/anomic/plasma/parser/Word.java b/source/de/anomic/plasma/parser/Word.javaindex bbbebbf51..221b1833d 100644--- a/source/de/anomic/plasma/parser/Word.java+++ b/source/de/anomic/plasma/parser/Word.java@@ -85,6 +85,8 @@ public class Word {byte[] h = hashCache.get(word);if (h != null) return h;h = Base64Order.enhancedCoder.encodeSubstring(Digest.encodeMD5Raw(word.toLowerCase(Locale.ENGLISH)), yacySeedDB.commonHashLength);+ assert h[2] != '@';+ String s = new String(h);hashCache.put(word, h); // prevent expensive MD5 computation and encodingreturn h;}