Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix: Index Administration > Reverse Word Index (IndexControlRWIs_p) corrected use of word search to word-hash search - removed duplicate QueryParams.hashes2Handles , redundant with .hashes2Set
reger566a3b029439
diff --git a/htroot/IndexControlRWIs_p.java b/htroot/IndexControlRWIs_p.javaindex 373498531..036b06919 100644--- a/htroot/IndexControlRWIs_p.java+++ b/htroot/IndexControlRWIs_p.java@@ -35,6 +35,8 @@ import java.util.List;import net.yacy.cora.date.GenericFormatter;import net.yacy.cora.document.ASCII;+import net.yacy.cora.document.analysis.Classification;+import net.yacy.cora.document.analysis.Classification.ContentDomain;import net.yacy.cora.federate.yacy.CacheStrategy;import net.yacy.cora.protocol.RequestHeader;import net.yacy.cora.storage.HandleSet;@@ -62,10 +64,13 @@ import net.yacy.repository.Blacklist.BlacklistType;import net.yacy.search.Switchboard;import net.yacy.search.SwitchboardConstants;import net.yacy.search.index.Segment;+import net.yacy.search.query.QueryGoal;+import net.yacy.search.query.QueryModifier;import net.yacy.search.query.QueryParams;import net.yacy.search.query.SearchEvent;import net.yacy.search.query.SearchEventCache;import net.yacy.search.ranking.BlockRank;+import net.yacy.search.ranking.RankingProfile;import net.yacy.server.serverObjects;import net.yacy.server.serverSwitch;@@ -638,9 +643,36 @@ public class IndexControlRWIs_p {final byte[] keyhash,final Bitfield filter) {- String khw = ASCII.String(keyhash);- final QueryParams query = new QueryParams(khw, khw, -1, filter, segment, sb.getRanking(), "IndexControlRWIs_p");- final SearchEvent theSearch = SearchEventCache.getEvent(query, sb.peers, sb.tables, null, false, sb.loader, Integer.MAX_VALUE, Long.MAX_VALUE, (int) sb.getConfigLong(SwitchboardConstants.DHT_BURST_ROBINSON, 0), (int) sb.getConfigLong(SwitchboardConstants.DHT_BURST_MULTIWORD, 0));+ final HandleSet queryhashes = QueryParams.hashes2Set(ASCII.String(keyhash));+ final QueryGoal qg = new QueryGoal(queryhashes, null, queryhashes);+ final QueryParams query = new QueryParams(+ qg,+ new QueryModifier(),+ Integer.MAX_VALUE,+ "",+ ContentDomain.ALL,+ "", //lang+ null,+ CacheStrategy.IFFRESH,+ 1000, 0, //count, offset+ ".*", //urlmask+ null,+ null,+ QueryParams.Searchdom.LOCAL,+ -1,+ filter,+ false,+ null,+ DigestURI.TLD_any_zone_filter,+ "",+ false,+ sb.index,+ sb.getRanking(),+ "",//userAgent+ false,+ false,+ 0.0d, 0.0d, 0.0d);+ final SearchEvent theSearch = SearchEventCache.getEvent(query, sb.peers, sb.tables, null, false, sb.loader, Integer.MAX_VALUE, Long.MAX_VALUE, (int) sb.getConfigLong(SwitchboardConstants.DHT_BURST_ROBINSON, 0), (int) sb.getConfigLong(SwitchboardConstants.DHT_BURST_MULTIWORD, 0));if (theSearch.rwiProcess != null && theSearch.rwiProcess.isAlive()) try {theSearch.rwiProcess.join();} catch (InterruptedException e) {}if (theSearch.local_rwi_available.get() == 0) {prop.put("searchresult", 2);diff --git a/htroot/yacy/search.java b/htroot/yacy/search.javaindex 5de1fff5a..418b5d6f3 100644--- a/htroot/yacy/search.java+++ b/htroot/yacy/search.java@@ -258,7 +258,7 @@ public final class search {final long timer = System.currentTimeMillis();//final Map<byte[], ReferenceContainer<WordReference>>[] containers = sb.indexSegment.index().searchTerm(theQuery.queryHashes, theQuery.excludeHashes, plasmaSearchQuery.hashes2StringSet(urls));- final TreeMap<byte[], ReferenceContainer<WordReference>> incc = indexSegment.termIndex().searchConjunction(theQuery.getQueryGoal().getIncludeHashes(), QueryParams.hashes2Handles(urls));+ final TreeMap<byte[], ReferenceContainer<WordReference>> incc = indexSegment.termIndex().searchConjunction(theQuery.getQueryGoal().getIncludeHashes(), QueryParams.hashes2Set(urls));EventTracker.update(EventTracker.EClass.SEARCH, new ProfilingGraph.EventSearch(theQuery.id(true), SearchEventType.COLLECTION, "", incc.size(), System.currentTimeMillis() - timer), false);if (incc != null) {diff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.javaindex e400bc30b..ae85a79d7 100644--- a/source/net/yacy/search/query/QueryParams.java+++ b/source/net/yacy/search/query/QueryParams.java@@ -314,18 +314,6 @@ public final class QueryParams {return keyhashes;}- public static HandleSet hashes2Handles(final String query) {- final HandleSet keyhashes = new RowHandleSet(WordReferenceRow.urlEntryRow.primaryKeyLength, WordReferenceRow.urlEntryRow.objectOrder, 0);- if (query != null) {- for (int i = 0; i < (query.length() / Word.commonHashLength); i++) try {- keyhashes.put(ASCII.getBytes(query.substring(i * Word.commonHashLength, (i + 1) * Word.commonHashLength)));- } catch (final SpaceExceededException e) {- Log.logException(e);- }- }- return keyhashes;- }-public static String hashSet2hashString(final HandleSet hashes) {final byte[] bb = new byte[hashes.size() * Word.commonHashLength];int p = 0;