From bc6dd8194bac0613d028be00fd002773c49d75f6 Mon Sep 17 00:00:00 2001
From: orbiter
Date: Mon, 15 Jun 2009 11:49:00 +0000
Subject: [PATCH] refactoring: moved search query class to new search package
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6075 6c8d7289-2bf4-0310-a012-ef5d649a1542
---
htroot/AccessTracker_p.java | 8 ++--
htroot/ContentIntegrationPHPBB3_p.html | 7 +++
htroot/IndexControlRWIs_p.java | 4 +-
htroot/Ranking_p.java | 6 +--
htroot/api/timeline.java | 6 +--
htroot/index.java | 24 +++++-----
htroot/yacy/search.java | 38 +++++++--------
htroot/yacysearch.java | 32 ++++++-------
htroot/yacysearchitem.java | 14 +++---
htroot/yacysearchtrailer.java | 16 +++----
.../metadataPrototype/URLMetadataRow.java | 4 +-
source/de/anomic/plasma/plasmaGrafics.java | 3 +-
.../de/anomic/plasma/plasmaSearchEvent.java | 47 ++++++++++---------
.../plasma/plasmaSearchRankingProcess.java | 23 ++++-----
.../plasma/plasmaSearchRankingProfile.java | 14 +++---
.../de/anomic/plasma/plasmaSnippetCache.java | 19 ++++----
.../de/anomic/plasma/plasmaSwitchboard.java | 11 +++--
.../Query.java} | 11 +++--
source/de/anomic/yacy/yacySearch.java | 4 +-
19 files changed, 153 insertions(+), 138 deletions(-)
rename source/de/anomic/{plasma/plasmaSearchQuery.java => search/Query.java} (95%)
diff --git a/htroot/AccessTracker_p.java b/htroot/AccessTracker_p.java
index 3ddab339f..36ed8a0e7 100644
--- a/htroot/AccessTracker_p.java
+++ b/htroot/AccessTracker_p.java
@@ -37,8 +37,8 @@ import java.text.SimpleDateFormat;
import de.anomic.http.httpRequestHeader;
import de.anomic.net.natLib;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.search.Query;
import de.anomic.server.serverCore;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@@ -138,8 +138,8 @@ public class AccessTracker_p {
prop.put("page_num", entCount);
}
if ((page == 2) || (page == 4)) {
- final ArrayList array = (page == 2) ? sb.localSearches : sb.remoteSearches;
- plasmaSearchQuery searchProfile;
+ final ArrayList array = (page == 2) ? sb.localSearches : sb.remoteSearches;
+ Query searchProfile;
int m = Math.min(maxCount, array.size());
long qcountSum = 0;
long rcountSum = 0;
@@ -167,7 +167,7 @@ public class AccessTracker_p {
} else {
// remote search
prop.putHTML("page_list_" + entCount + "_peername", (searchProfile.remotepeer == null) ? "" : searchProfile.remotepeer.getName());
- prop.put("page_list_" + entCount + "_queryhashes", plasmaSearchQuery.anonymizedQueryHashes(searchProfile.queryHashes));
+ prop.put("page_list_" + entCount + "_queryhashes", Query.anonymizedQueryHashes(searchProfile.queryHashes));
}
prop.putNum("page_list_" + entCount + "_querycount", searchProfile.linesPerPage);
prop.putNum("page_list_" + entCount + "_resultcount", searchProfile.resultcount);
diff --git a/htroot/ContentIntegrationPHPBB3_p.html b/htroot/ContentIntegrationPHPBB3_p.html
index 6c165e26e..d4b137fe8 100644
--- a/htroot/ContentIntegrationPHPBB3_p.html
+++ b/htroot/ContentIntegrationPHPBB3_p.html
@@ -13,6 +13,13 @@
Each extraction is specific to the data that is hosted in the database.
This interface gives you access to the phpBB3 forums software content.
+
+ If you read from a imported database, here are some hints to get around problems when importing dumps in phpMyAdmin:
+
+
When a export is started, surrogate files are generated into DATA/SURROGATE/in which are automatically fetched by an indexer thread.
All indexed surrogate files are then moved to DATA/SURROGATE/out and can be re-cycled when a index is deleted.
diff --git a/htroot/IndexControlRWIs_p.java b/htroot/IndexControlRWIs_p.java
index e37f6eac4..90b5d9150 100644
--- a/htroot/IndexControlRWIs_p.java
+++ b/htroot/IndexControlRWIs_p.java
@@ -50,11 +50,11 @@ import de.anomic.kelondro.text.referencePrototype.WordReference;
import de.anomic.kelondro.text.referencePrototype.WordReferenceRow;
import de.anomic.kelondro.util.DateFormatter;
import de.anomic.plasma.plasmaSearchEvent;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSearchRankingProcess;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.parser.Condenser;
import de.anomic.plasma.parser.Word;
+import de.anomic.search.Query;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.yacy.yacyClient;
@@ -478,7 +478,7 @@ public class IndexControlRWIs_p {
}
public static plasmaSearchRankingProcess genSearchresult(final serverObjects prop, final plasmaSwitchboard sb, final byte[] keyhash, final Bitfield filter) {
- final plasmaSearchQuery query = new plasmaSearchQuery(new String(keyhash), -1, sb.getRanking(), filter);
+ final Query query = new Query(new String(keyhash), -1, sb.getRanking(), filter);
final plasmaSearchRankingProcess ranked = new plasmaSearchRankingProcess(sb.indexSegment, query, Integer.MAX_VALUE, 1);
ranked.execQuery();
diff --git a/htroot/Ranking_p.java b/htroot/Ranking_p.java
index 3768cefcf..16f29cbb7 100644
--- a/htroot/Ranking_p.java
+++ b/htroot/Ranking_p.java
@@ -31,9 +31,9 @@ import java.util.Map.Entry;
import de.anomic.http.httpRequestHeader;
import de.anomic.plasma.plasmaSearchEvent;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSearchRankingProfile;
import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.search.Query;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.tools.crypt;
@@ -139,7 +139,7 @@ public class Ranking_p {
// we create empty entries for template strings
final serverObjects prop = defaultValues();
final plasmaSearchRankingProfile ranking;
- if(sb == null) ranking = new plasmaSearchRankingProfile(plasmaSearchQuery.CONTENTDOM_TEXT);
+ if(sb == null) ranking = new plasmaSearchRankingProfile(Query.CONTENTDOM_TEXT);
else ranking = sb.getRanking();
putRanking(prop, ranking, "local");
return prop;
@@ -156,7 +156,7 @@ public class Ranking_p {
if (post.containsKey("ResetRanking")) {
sb.setConfig("rankingProfile", "");
- final plasmaSearchRankingProfile ranking = new plasmaSearchRankingProfile(plasmaSearchQuery.CONTENTDOM_TEXT);
+ final plasmaSearchRankingProfile ranking = new plasmaSearchRankingProfile(Query.CONTENTDOM_TEXT);
final serverObjects prop = defaultValues();
//prop.putAll(ranking.toExternalMap("local"));
putRanking(prop, ranking, "local");
diff --git a/htroot/api/timeline.java b/htroot/api/timeline.java
index 239f40f27..553f5ff84 100644
--- a/htroot/api/timeline.java
+++ b/htroot/api/timeline.java
@@ -34,9 +34,9 @@ import de.anomic.kelondro.text.Segment;
import de.anomic.kelondro.text.TermSearch;
import de.anomic.kelondro.text.referencePrototype.WordReference;
import de.anomic.kelondro.util.DateFormatter;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.parser.Word;
+import de.anomic.search.Query;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.tools.iso639;
@@ -63,7 +63,7 @@ public final class timeline {
language = (agent == null) ? "en" : iso639.userAgentLanguageDetection(agent);
if (language == null) language = "en";
}
- final TreeSet[] query = plasmaSearchQuery.cleanQuery(querystring); // converts also umlaute
+ final TreeSet[] query = Query.cleanQuery(querystring); // converts also umlaute
TreeSet q = Word.words2hashes(query[0]);
// tell all threads to do nothing for a specific time
@@ -108,7 +108,7 @@ public final class timeline {
// log
yacyCore.log.logInfo("EXIT TIMELINE SEARCH: " +
- plasmaSearchQuery.anonymizedQueryHashes(q) + " - " + joincount + " links found, " +
+ Query.anonymizedQueryHashes(q) + " - " + joincount + " links found, " +
prop.get("linkcount", "?") + " links selected, " +
indexabstractContainercount + " index abstracts, " +
(System.currentTimeMillis() - timestamp) + " milliseconds");
diff --git a/htroot/index.java b/htroot/index.java
index ae68473fc..b6e906df2 100644
--- a/htroot/index.java
+++ b/htroot/index.java
@@ -30,9 +30,9 @@
import de.anomic.http.httpRequestHeader;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaSwitchboardConstants;
+import de.anomic.search.Query;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@@ -79,13 +79,13 @@ public class index {
//global = global && indexDistributeGranted && indexReceiveGranted;
// search domain
- int contentdom = plasmaSearchQuery.CONTENTDOM_TEXT;
+ int contentdom = Query.CONTENTDOM_TEXT;
final String cds = (post == null) ? "text" : post.get("contentdom", "text");
- if (cds.equals("text")) contentdom = plasmaSearchQuery.CONTENTDOM_TEXT;
- if (cds.equals("audio")) contentdom = plasmaSearchQuery.CONTENTDOM_AUDIO;
- if (cds.equals("video")) contentdom = plasmaSearchQuery.CONTENTDOM_VIDEO;
- if (cds.equals("image")) contentdom = plasmaSearchQuery.CONTENTDOM_IMAGE;
- if (cds.equals("app")) contentdom = plasmaSearchQuery.CONTENTDOM_APP;
+ if (cds.equals("text")) contentdom = Query.CONTENTDOM_TEXT;
+ if (cds.equals("audio")) contentdom = Query.CONTENTDOM_AUDIO;
+ if (cds.equals("video")) contentdom = Query.CONTENTDOM_VIDEO;
+ if (cds.equals("image")) contentdom = Query.CONTENTDOM_IMAGE;
+ if (cds.equals("app")) contentdom = Query.CONTENTDOM_APP;
// we create empty entries for template strings
String promoteSearchPageGreeting = env.getConfig(plasmaSwitchboardConstants.GREETING, "");
@@ -120,11 +120,11 @@ public class index {
prop.put("display", display);
prop.putHTML("constraint", constraint);
prop.put("searchoptions_display", display);
- prop.put("contentdomCheckText", (contentdom == plasmaSearchQuery.CONTENTDOM_TEXT) ? "1" : "0");
- prop.put("contentdomCheckAudio", (contentdom == plasmaSearchQuery.CONTENTDOM_AUDIO) ? "1" : "0");
- prop.put("contentdomCheckVideo", (contentdom == plasmaSearchQuery.CONTENTDOM_VIDEO) ? "1" : "0");
- prop.put("contentdomCheckImage", (contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) ? "1" : "0");
- prop.put("contentdomCheckApp", (contentdom == plasmaSearchQuery.CONTENTDOM_APP) ? "1" : "0");
+ prop.put("contentdomCheckText", (contentdom == Query.CONTENTDOM_TEXT) ? "1" : "0");
+ prop.put("contentdomCheckAudio", (contentdom == Query.CONTENTDOM_AUDIO) ? "1" : "0");
+ prop.put("contentdomCheckVideo", (contentdom == Query.CONTENTDOM_VIDEO) ? "1" : "0");
+ prop.put("contentdomCheckImage", (contentdom == Query.CONTENTDOM_IMAGE) ? "1" : "0");
+ prop.put("contentdomCheckApp", (contentdom == Query.CONTENTDOM_APP) ? "1" : "0");
// online caution timing
sb.localSearchLastAccess = System.currentTimeMillis();
diff --git a/htroot/yacy/search.java b/htroot/yacy/search.java
index 4d36a065c..143fa3480 100644
--- a/htroot/yacy/search.java
+++ b/htroot/yacy/search.java
@@ -44,11 +44,11 @@ import de.anomic.kelondro.util.SortStack;
import de.anomic.net.natLib;
import de.anomic.plasma.plasmaProfiling;
import de.anomic.plasma.plasmaSearchEvent;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSearchRankingProfile;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaSearchEvent.ResultEntry;
import de.anomic.plasma.plasmaSearchRankingProcess.NavigatorEntry;
+import de.anomic.search.Query;
import de.anomic.server.serverCore;
import de.anomic.server.serverObjects;
import de.anomic.server.serverProfiling;
@@ -157,7 +157,7 @@ public final class search {
// tell all threads to do nothing for a specific time
sb.intermissionAllThreads(3000);
- final TreeSet abstractSet = ((abstracts.length() == 0) || (abstracts.equals("auto"))) ? null : plasmaSearchQuery.hashes2Set(abstracts);
+ final TreeSet abstractSet = ((abstracts.length() == 0) || (abstracts.equals("auto"))) ? null : Query.hashes2Set(abstracts);
// store accessing peer
final yacySeed remoteSeed = yacySeed.genRemoteSeed(oseed, key, false);
@@ -168,23 +168,23 @@ public final class search {
}
// prepare search
- final TreeSet queryhashes = plasmaSearchQuery.hashes2Set(query);
- final TreeSet excludehashes = (exclude.length() == 0) ? new TreeSet(Base64Order.enhancedCoder) : plasmaSearchQuery.hashes2Set(exclude);
+ final TreeSet queryhashes = Query.hashes2Set(query);
+ final TreeSet excludehashes = (exclude.length() == 0) ? new TreeSet(Base64Order.enhancedCoder) : Query.hashes2Set(exclude);
final long timestamp = System.currentTimeMillis();
// prepare a search profile
- final plasmaSearchRankingProfile rankingProfile = (profile.length() == 0) ? new plasmaSearchRankingProfile(plasmaSearchQuery.contentdomParser(contentdom)) : new plasmaSearchRankingProfile("", profile);
+ final plasmaSearchRankingProfile rankingProfile = (profile.length() == 0) ? new plasmaSearchRankingProfile(Query.contentdomParser(contentdom)) : new plasmaSearchRankingProfile("", profile);
// prepare an abstract result
final StringBuilder indexabstract = new StringBuilder();
int indexabstractContainercount = 0;
int joincount = 0;
- plasmaSearchQuery theQuery = null;
+ Query theQuery = null;
ArrayList.stackElement> accu = null;
plasmaSearchEvent theSearch = null;
if ((query.length() == 0) && (abstractSet != null)) {
// this is _not_ a normal search, only a request for index abstracts
- theQuery = new plasmaSearchQuery(
+ theQuery = new Query(
null,
abstractSet,
new TreeSet(Base64Order.enhancedCoder),
@@ -192,14 +192,14 @@ public final class search {
rankingProfile,
maxdist,
prefer,
- plasmaSearchQuery.contentdomParser(contentdom),
+ Query.contentdomParser(contentdom),
language,
"", // no navigation
false,
count,
0,
filter,
- plasmaSearchQuery.SEARCHDOM_LOCAL,
+ Query.SEARCHDOM_LOCAL,
null,
-1,
null,
@@ -209,12 +209,12 @@ public final class search {
yacyURL.TLD_any_zone_filter,
client,
false);
- theQuery.domType = plasmaSearchQuery.SEARCHDOM_LOCAL;
- yacyCore.log.logInfo("INIT HASH SEARCH (abstracts only): " + plasmaSearchQuery.anonymizedQueryHashes(theQuery.queryHashes) + " - " + theQuery.displayResults() + " links");
+ theQuery.domType = Query.SEARCHDOM_LOCAL;
+ yacyCore.log.logInfo("INIT HASH SEARCH (abstracts only): " + Query.anonymizedQueryHashes(theQuery.queryHashes) + " - " + theQuery.displayResults() + " links");
final long timer = System.currentTimeMillis();
//final Map>[] containers = sb.indexSegment.index().searchTerm(theQuery.queryHashes, theQuery.excludeHashes, plasmaSearchQuery.hashes2StringSet(urls));
- final HashMap> incc = sb.indexSegment.termIndex().searchConjunction(theQuery.queryHashes, plasmaSearchQuery.hashes2StringSet(urls));
+ final HashMap> incc = sb.indexSegment.termIndex().searchConjunction(theQuery.queryHashes, Query.hashes2StringSet(urls));
serverProfiling.update("SEARCH", new plasmaProfiling.searchEvent(theQuery.id(true), plasmaSearchEvent.COLLECTION, incc.size(), System.currentTimeMillis() - timer), false);
if (incc != null) {
@@ -236,7 +236,7 @@ public final class search {
} else {
// retrieve index containers from search request
- theQuery = new plasmaSearchQuery(
+ theQuery = new Query(
null,
queryhashes,
excludehashes,
@@ -244,7 +244,7 @@ public final class search {
rankingProfile,
maxdist,
prefer,
- plasmaSearchQuery.
+ Query.
contentdomParser(contentdom),
language,
"", // no navigation
@@ -252,7 +252,7 @@ public final class search {
count,
0,
filter,
- plasmaSearchQuery.SEARCHDOM_LOCAL,
+ Query.SEARCHDOM_LOCAL,
null,
-1,
constraint,
@@ -262,9 +262,9 @@ public final class search {
yacyURL.TLD_any_zone_filter,
client,
false);
- theQuery.domType = plasmaSearchQuery.SEARCHDOM_LOCAL;
- yacyCore.log.logInfo("INIT HASH SEARCH (query-" + abstracts + "): " + plasmaSearchQuery.anonymizedQueryHashes(theQuery.queryHashes) + " - " + theQuery.displayResults() + " links");
- RSSFeed.channels(RSSFeed.REMOTESEARCH).addMessage(new RSSMessage("Remote Search Request from " + ((remoteSeed == null) ? "unknown" : remoteSeed.getName()), plasmaSearchQuery.anonymizedQueryHashes(theQuery.queryHashes), ""));
+ theQuery.domType = Query.SEARCHDOM_LOCAL;
+ yacyCore.log.logInfo("INIT HASH SEARCH (query-" + abstracts + "): " + Query.anonymizedQueryHashes(theQuery.queryHashes) + " - " + theQuery.displayResults() + " links");
+ RSSFeed.channels(RSSFeed.REMOTESEARCH).addMessage(new RSSMessage("Remote Search Request from " + ((remoteSeed == null) ? "unknown" : remoteSeed.getName()), Query.anonymizedQueryHashes(theQuery.queryHashes), ""));
// make event
theSearch = plasmaSearchEvent.getEvent(theQuery, rankingProfile, sb.indexSegment, sb.peers, sb.crawlResults, null, true);
@@ -382,7 +382,7 @@ public final class search {
// log
yacyCore.log.logInfo("EXIT HASH SEARCH: " +
- plasmaSearchQuery.anonymizedQueryHashes(theQuery.queryHashes) + " - " + joincount + " links found, " +
+ Query.anonymizedQueryHashes(theQuery.queryHashes) + " - " + joincount + " links found, " +
prop.get("linkcount", "?") + " links selected, " +
indexabstractContainercount + " index abstracts, " +
(System.currentTimeMillis() - timestamp) + " milliseconds");
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index d1b019560..0fbf119aa 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -42,13 +42,13 @@ import de.anomic.kelondro.util.Log;
import de.anomic.plasma.plasmaParserDocument;
import de.anomic.plasma.plasmaProfiling;
import de.anomic.plasma.plasmaSearchEvent;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSearchRankingProfile;
import de.anomic.plasma.plasmaSnippetCache;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaSwitchboardConstants;
import de.anomic.plasma.parser.Word;
import de.anomic.plasma.parser.Condenser;
+import de.anomic.search.Query;
import de.anomic.server.serverCore;
import de.anomic.server.serverDomains;
import de.anomic.server.serverObjects;
@@ -177,10 +177,10 @@ public class yacysearch {
if (clustersearch) global = true; // switches search on, but search target is limited to cluster nodes
// find search domain
- final int contentdomCode = plasmaSearchQuery.contentdomParser((post == null ? "text" : post.get("contentdom", "text")));
+ final int contentdomCode = Query.contentdomParser((post == null ? "text" : post.get("contentdom", "text")));
// patch until better search profiles are available
- if ((contentdomCode != plasmaSearchQuery.CONTENTDOM_TEXT) && (itemsPerPage <= 32)) itemsPerPage = 32;
+ if ((contentdomCode != Query.CONTENTDOM_TEXT) && (itemsPerPage <= 32)) itemsPerPage = 32;
// check the search tracker
TreeSet trackerHandles = sb.localSearchTracker.get(client);
@@ -340,7 +340,7 @@ public class yacysearch {
String navigation = (post == null) ? "" : post.get("nav", "");
// the query
- final TreeSet[] query = plasmaSearchQuery.cleanQuery(querystring.trim()); // converts also umlaute
+ final TreeSet[] query = Query.cleanQuery(querystring.trim()); // converts also umlaute
int maxDistance = (querystring.indexOf('"') >= 0) ? maxDistance = query.length - 1 : Integer.MAX_VALUE;
@@ -403,7 +403,7 @@ public class yacysearch {
// do the search
final TreeSet queryHashes = Word.words2hashes(query[0]);
- final plasmaSearchQuery theQuery = new plasmaSearchQuery(
+ final Query theQuery = new Query(
originalquerystring,
queryHashes,
Word.words2hashes(query[1]),
@@ -418,8 +418,8 @@ public class yacysearch {
itemsPerPage,
offset,
urlmask,
- (clustersearch && globalsearch) ? plasmaSearchQuery.SEARCHDOM_CLUSTERALL :
- ((globalsearch) ? plasmaSearchQuery.SEARCHDOM_GLOBALDHT : plasmaSearchQuery.SEARCHDOM_LOCAL),
+ (clustersearch && globalsearch) ? Query.SEARCHDOM_CLUSTERALL :
+ ((globalsearch) ? Query.SEARCHDOM_GLOBALDHT : Query.SEARCHDOM_LOCAL),
"",
20,
constraint,
@@ -438,7 +438,7 @@ public class yacysearch {
theQuery.filterOut(plasmaSwitchboard.blueList);
// log
- 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");
+ Log.logInfo("LOCAL_SEARCH", "INIT WORD SEARCH: " + theQuery.queryString + ":" + Query.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();
@@ -535,7 +535,7 @@ public class yacysearch {
resnav.append(" ");
} else {
resnav.append(" ");
}
final int numberofpages = Math.min(10, Math.min(thispage + 2, totalcount / theQuery.displayResults()));
@@ -546,7 +546,7 @@ public class yacysearch {
resnav.append(".gif\" width=\"16\" height=\"16\"> ");
} else {
resnav.append(" ");
@@ -556,7 +556,7 @@ public class yacysearch {
resnav.append("");
} else {
resnav.append("");
}
prop.put("num-results_resnav", resnav.toString());
@@ -612,11 +612,11 @@ public class yacysearch {
prop.put("constraint", (constraint == null) ? "" : constraint.exportB64());
prop.put("verify", (fetchSnippets) ? "true" : "false");
prop.put("contentdom", (post == null ? "text" : post.get("contentdom", "text")));
- prop.put("contentdomCheckText", (contentdomCode == plasmaSearchQuery.CONTENTDOM_TEXT) ? "1" : "0");
- prop.put("contentdomCheckAudio", (contentdomCode == plasmaSearchQuery.CONTENTDOM_AUDIO) ? "1" : "0");
- prop.put("contentdomCheckVideo", (contentdomCode == plasmaSearchQuery.CONTENTDOM_VIDEO) ? "1" : "0");
- prop.put("contentdomCheckImage", (contentdomCode == plasmaSearchQuery.CONTENTDOM_IMAGE) ? "1" : "0");
- prop.put("contentdomCheckApp", (contentdomCode == plasmaSearchQuery.CONTENTDOM_APP) ? "1" : "0");
+ prop.put("contentdomCheckText", (contentdomCode == Query.CONTENTDOM_TEXT) ? "1" : "0");
+ prop.put("contentdomCheckAudio", (contentdomCode == Query.CONTENTDOM_AUDIO) ? "1" : "0");
+ prop.put("contentdomCheckVideo", (contentdomCode == Query.CONTENTDOM_VIDEO) ? "1" : "0");
+ prop.put("contentdomCheckImage", (contentdomCode == Query.CONTENTDOM_IMAGE) ? "1" : "0");
+ prop.put("contentdomCheckApp", (contentdomCode == Query.CONTENTDOM_APP) ? "1" : "0");
// for RSS: don't HTML encode some elements
prop.putXML("rss_query", originalquerystring);
diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java
index be555599e..f3158a58e 100644
--- a/htroot/yacysearchitem.java
+++ b/htroot/yacysearchitem.java
@@ -33,10 +33,10 @@ import java.util.TreeSet;
import de.anomic.http.httpRequestHeader;
import de.anomic.plasma.plasmaProfiling;
import de.anomic.plasma.plasmaSearchEvent;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSearchRankingProcess;
import de.anomic.plasma.plasmaSnippetCache;
import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.search.Query;
import de.anomic.server.serverObjects;
import de.anomic.server.serverProfiling;
import de.anomic.server.serverSwitch;
@@ -77,7 +77,7 @@ public class yacysearchitem {
// the event does not exist, show empty page
return prop;
}
- final plasmaSearchQuery theQuery = theSearch.getQuery();
+ final Query theQuery = theSearch.getQuery();
// dynamically update count values
final int offset = theQuery.neededResults() - theQuery.displayResults() + 1;
@@ -89,7 +89,7 @@ public class yacysearchitem {
prop.put("remoteIndexCount", Formatter.number(theSearch.getRankingResult().getRemoteIndexCount(), true));
prop.put("remotePeerCount", Formatter.number(theSearch.getRankingResult().getRemotePeerCount(), true));
- if (theQuery.contentdom == plasmaSearchQuery.CONTENTDOM_TEXT) {
+ if (theQuery.contentdom == Query.CONTENTDOM_TEXT) {
// text search
// generate result object
@@ -151,7 +151,7 @@ public class yacysearchitem {
return prop;
}
- if (theQuery.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) {
+ if (theQuery.contentdom == Query.CONTENTDOM_IMAGE) {
// image search; shows thumbnails
prop.put("content", theQuery.contentdom + 1); // switch on specific content
@@ -171,9 +171,9 @@ public class yacysearchitem {
return prop;
}
- if ((theQuery.contentdom == plasmaSearchQuery.CONTENTDOM_AUDIO) ||
- (theQuery.contentdom == plasmaSearchQuery.CONTENTDOM_VIDEO) ||
- (theQuery.contentdom == plasmaSearchQuery.CONTENTDOM_APP)) {
+ if ((theQuery.contentdom == Query.CONTENTDOM_AUDIO) ||
+ (theQuery.contentdom == Query.CONTENTDOM_VIDEO) ||
+ (theQuery.contentdom == Query.CONTENTDOM_APP)) {
// any other media content
// generate result object
diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.java
index 87e0fd903..b0a7ecba4 100644
--- a/htroot/yacysearchtrailer.java
+++ b/htroot/yacysearchtrailer.java
@@ -30,8 +30,8 @@ import java.util.Iterator;
import de.anomic.http.httpRequestHeader;
import de.anomic.plasma.plasmaProfiling;
import de.anomic.plasma.plasmaSearchEvent;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSearchRankingProcess.NavigatorEntry;
+import de.anomic.search.Query;
import de.anomic.server.serverObjects;
import de.anomic.server.serverProfiling;
import de.anomic.server.serverSwitch;
@@ -53,7 +53,7 @@ public class yacysearchtrailer {
// the event does not exist, show empty page
return prop;
}
- final plasmaSearchQuery theQuery = theSearch.getQuery();
+ final Query theQuery = theSearch.getQuery();
// compose search navigation
@@ -68,8 +68,8 @@ public class yacysearchtrailer {
for (i = 0; i < hostNavigator.size(); i++) {
entry = hostNavigator.get(i);
prop.put("nav-domains_element_" + i + "_name", entry.name);
- prop.put("nav-domains_element_" + i + "_url", "" + entry.name + " (" + entry.count + ")");
- prop.putJSON("nav-domains_element_" + i + "_url-json", plasmaSearchQuery.navurl("json", 0, display, theQuery, theQuery.urlMask, "site:" + entry.name, theQuery.navigators));
+ prop.put("nav-domains_element_" + i + "_url", "" + entry.name + " (" + entry.count + ")");
+ prop.putJSON("nav-domains_element_" + i + "_url-json", Query.navurl("json", 0, display, theQuery, theQuery.urlMask, "site:" + entry.name, theQuery.navigators));
prop.put("nav-domains_element_" + i + "_count", entry.count);
prop.put("nav-domains_element_" + i + "_modifier", "site:" + entry.name);
prop.put("nav-domains_element_" + i + "_nl", 1);
@@ -92,8 +92,8 @@ public class yacysearchtrailer {
entry = authorNavigator.get(i);
anav = (entry.name.indexOf(' ') < 0) ? "author:" + entry.name : "author:'" + entry.name + "'";
prop.put("nav-authors_element_" + i + "_name", entry.name);
- prop.put("nav-authors_element_" + i + "_url", "" + entry.name + " (" + entry.count + ")");
- prop.putJSON("nav-authors_element_" + i + "_url-json", plasmaSearchQuery.navurl("json", 0, display, theQuery, theQuery.urlMask, anav, theQuery.navigators));
+ prop.put("nav-authors_element_" + i + "_url", "" + entry.name + " (" + entry.count + ")");
+ prop.putJSON("nav-authors_element_" + i + "_url-json", Query.navurl("json", 0, display, theQuery, theQuery.urlMask, anav, theQuery.navigators));
prop.put("nav-authors_element_" + i + "_count", entry.count);
prop.put("nav-authors_element_" + i + "_modifier", "author:'" + entry.name + "'");
prop.put("nav-authors_element_" + i + "_nl", 1);
@@ -114,8 +114,8 @@ public class yacysearchtrailer {
if (/*(theQuery == null) ||*/ (theQuery.queryString == null)) break;
if (e != null && e.name != null) {
prop.putHTML("nav-topics_element_" + i + "_name", e.name);
- prop.put("nav-topics_element_" + i + "_url", "" + e.name + " (" + e.count + ")");
- prop.putJSON("nav-topics_element_" + i + "_url-json", plasmaSearchQuery.navurl("json", 0, display, theQuery, theQuery.urlMask, e.name, theQuery.navigators));
+ prop.put("nav-topics_element_" + i + "_url", "" + e.name + " (" + e.count + ")");
+ prop.putJSON("nav-topics_element_" + i + "_url-json", Query.navurl("json", 0, display, theQuery, theQuery.urlMask, e.name, theQuery.navigators));
prop.put("nav-topics_element_" + i + "_count", e.count);
prop.put("nav-topics_element_" + i + "_modifier", e.name);
prop.put("nav-topics_element_" + i + "_nl", (iter.hasNext() && i < MAX_TOPWORDS) ? 1 : 0);
diff --git a/source/de/anomic/kelondro/text/metadataPrototype/URLMetadataRow.java b/source/de/anomic/kelondro/text/metadataPrototype/URLMetadataRow.java
index a5c96cf13..6ed485c74 100644
--- a/source/de/anomic/kelondro/text/metadataPrototype/URLMetadataRow.java
+++ b/source/de/anomic/kelondro/text/metadataPrototype/URLMetadataRow.java
@@ -45,7 +45,7 @@ import de.anomic.kelondro.text.referencePrototype.WordReferenceRow;
import de.anomic.kelondro.util.DateFormatter;
import de.anomic.kelondro.util.FileUtils;
import de.anomic.kelondro.util.kelondroException;
-import de.anomic.plasma.plasmaSearchQuery;
+import de.anomic.search.Query;
import de.anomic.server.serverCharBuffer;
import de.anomic.server.serverCodings;
import de.anomic.tools.crypt;
@@ -254,7 +254,7 @@ public class URLMetadataRow implements Metadata {
this.entry.setCol(col_wc, Integer.parseInt(prop.getProperty("wc", "0")));
this.entry.setCol(col_dt, new byte[]{(byte) prop.getProperty("dt", "t").charAt(0)});
final String flags = prop.getProperty("flags", "AAAAAA");
- this.entry.setCol(col_flags, (flags.length() > 6) ? plasmaSearchQuery.empty_constraint.bytes() : (new Bitfield(4, flags)).bytes());
+ this.entry.setCol(col_flags, (flags.length() > 6) ? Query.empty_constraint.bytes() : (new Bitfield(4, flags)).bytes());
try {
this.entry.setCol(col_lang, prop.getProperty("lang", "uk").getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
diff --git a/source/de/anomic/plasma/plasmaGrafics.java b/source/de/anomic/plasma/plasmaGrafics.java
index 7e8a0e383..f6556a878 100644
--- a/source/de/anomic/plasma/plasmaGrafics.java
+++ b/source/de/anomic/plasma/plasmaGrafics.java
@@ -35,6 +35,7 @@ import java.awt.image.BufferedImage;
import java.util.Date;
import java.util.Iterator;
+import de.anomic.search.Query;
import de.anomic.yacy.yacySearch;
import de.anomic.yacy.yacySeed;
import de.anomic.yacy.yacySeedDB;
@@ -144,7 +145,7 @@ public class plasmaGrafics {
}
// draw in the search target
- final plasmaSearchQuery query = event.getQuery();
+ final Query query = event.getQuery();
final Iterator i = query.queryHashes.iterator();
eventPicture.setColor(ymageMatrix.GREY);
while (i.hasNext()) {
diff --git a/source/de/anomic/plasma/plasmaSearchEvent.java b/source/de/anomic/plasma/plasmaSearchEvent.java
index f6a53c989..399f853b2 100644
--- a/source/de/anomic/plasma/plasmaSearchEvent.java
+++ b/source/de/anomic/plasma/plasmaSearchEvent.java
@@ -54,6 +54,7 @@ import de.anomic.plasma.parser.Word;
import de.anomic.plasma.parser.Condenser;
import de.anomic.plasma.plasmaSearchRankingProcess.NavigatorEntry;
import de.anomic.plasma.plasmaSnippetCache.MediaSnippet;
+import de.anomic.search.Query;
import de.anomic.server.serverProfiling;
import de.anomic.yacy.yacySearch;
import de.anomic.yacy.yacySeed;
@@ -75,10 +76,10 @@ public final class plasmaSearchEvent {
public static String lastEventID = "";
private static ConcurrentHashMap lastEvents = new ConcurrentHashMap(); // a cache for objects from this class: re-use old search requests
public static final long eventLifetime = 60000; // the time an event will stay in the cache, 1 Minute
- private static final int max_results_preparation = 300;
+ private static final int max_results_preparation = 1000;
private long eventTime;
- plasmaSearchQuery query;
+ Query query;
private final Segment indexSegment;
private final yacySeedDB peers;
plasmaSearchRankingProcess rankedCache; // ordered search results, grows dynamically as all the query threads enrich this container
@@ -100,7 +101,7 @@ public final class plasmaSearchEvent {
public ResultURLs crawlResults;
@SuppressWarnings("unchecked")
- private plasmaSearchEvent(final plasmaSearchQuery query,
+ private plasmaSearchEvent(final Query query,
final Segment indexSegment,
final yacySeedDB peers,
final ResultURLs crawlResults,
@@ -136,8 +137,8 @@ public final class plasmaSearchEvent {
}
final long start = System.currentTimeMillis();
- if ((query.domType == plasmaSearchQuery.SEARCHDOM_GLOBALDHT) ||
- (query.domType == plasmaSearchQuery.SEARCHDOM_CLUSTERALL)) {
+ if ((query.domType == Query.SEARCHDOM_GLOBALDHT) ||
+ (query.domType == Query.SEARCHDOM_CLUSTERALL)) {
// initialize a ranking process that is the target for data
// that is generated concurrently from local and global search threads
@@ -152,8 +153,8 @@ public final class plasmaSearchEvent {
final int fetchpeers = 12;
Log.logFine("SEARCH_EVENT", "STARTING " + fetchpeers + " THREADS TO CATCH EACH " + query.displayResults() + " URLs");
this.primarySearchThreads = yacySearch.primaryRemoteSearches(
- plasmaSearchQuery.hashSet2hashString(query.queryHashes),
- plasmaSearchQuery.hashSet2hashString(query.excludeHashes),
+ Query.hashSet2hashString(query.queryHashes),
+ Query.hashSet2hashString(query.excludeHashes),
"",
query.prefer,
query.urlMask,
@@ -171,7 +172,7 @@ public final class plasmaSearchEvent {
plasmaSwitchboard.urlBlacklist,
query.ranking,
query.constraint,
- (query.domType == plasmaSearchQuery.SEARCHDOM_GLOBALDHT) ? null : preselectedPeerHashes);
+ (query.domType == Query.SEARCHDOM_GLOBALDHT) ? null : preselectedPeerHashes);
serverProfiling.update("SEARCH", new plasmaProfiling.searchEvent(query.id(true), "remote search thread start", this.primarySearchThreads.length, System.currentTimeMillis() - timer), false);
// finished searching
@@ -303,9 +304,9 @@ public final class plasmaSearchEvent {
final long dbRetrievalTime = System.currentTimeMillis() - startTime;
// check exclusion
- if ((plasmaSearchQuery.matches(pagetitle, query.excludeHashes)) ||
- (plasmaSearchQuery.matches(pageurl, query.excludeHashes)) ||
- (plasmaSearchQuery.matches(pageauthor, query.excludeHashes))) {
+ if ((Query.matches(pagetitle, query.excludeHashes)) ||
+ (Query.matches(pageurl, query.excludeHashes)) ||
+ (Query.matches(pageauthor, query.excludeHashes))) {
return null;
}
@@ -324,19 +325,19 @@ public final class plasmaSearchEvent {
return null;
}
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_AUDIO) && (page.laudio() == 0)) {
+ if ((query.contentdom == Query.CONTENTDOM_AUDIO) && (page.laudio() == 0)) {
registerFailure(page.hash(), "contentdom-audio constraint not fullfilled");
return null;
}
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_VIDEO) && (page.lvideo() == 0)) {
+ if ((query.contentdom == Query.CONTENTDOM_VIDEO) && (page.lvideo() == 0)) {
registerFailure(page.hash(), "contentdom-video constraint not fullfilled");
return null;
}
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) && (page.limage() == 0)) {
+ if ((query.contentdom == Query.CONTENTDOM_IMAGE) && (page.limage() == 0)) {
registerFailure(page.hash(), "contentdom-image constraint not fullfilled");
return null;
}
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_APP) && (page.lapp() == 0)) {
+ if ((query.contentdom == Query.CONTENTDOM_APP) && (page.lapp() == 0)) {
registerFailure(page.hash(), "contentdom-app constraint not fullfilled");
return null;
}
@@ -346,7 +347,7 @@ public final class plasmaSearchEvent {
}
// load snippet
- if (query.contentdom == plasmaSearchQuery.CONTENTDOM_TEXT) {
+ if (query.contentdom == Query.CONTENTDOM_TEXT) {
// attach text snippet
startTime = System.currentTimeMillis();
final plasmaSnippetCache.TextSnippet snippet = plasmaSnippetCache.retrieveTextSnippet(metadata, snippetFetchWordHashes, (snippetFetchMode == 2), ((query.constraint != null) && (query.constraint.get(Condenser.flag_cat_indexof))), 180, 3000, (snippetFetchMode == 2) ? Integer.MAX_VALUE : 30000, query.isGlobal());
@@ -429,7 +430,7 @@ public final class plasmaSearchEvent {
return count;
}
- public plasmaSearchQuery getQuery() {
+ public Query getQuery() {
return query;
}
@@ -458,7 +459,7 @@ public final class plasmaSearchEvent {
}
public static plasmaSearchEvent getEvent(
- final plasmaSearchQuery query,
+ final Query query,
final plasmaSearchRankingProfile ranking,
final Segment indexSegment,
final yacySeedDB peers,
@@ -488,7 +489,7 @@ public final class plasmaSearchEvent {
} else {
// if worker threads had been alive, but did not succeed, start them again to fetch missing links
if ((!event.anyWorkerAlive()) &&
- (((query.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) && (event.images.size() + 30 < query.neededResults())) ||
+ (((query.contentdom == Query.CONTENTDOM_IMAGE) && (event.images.size() + 30 < query.neededResults())) ||
(event.result.size() < query.neededResults() + 10)) &&
//(event.query.onlineSnippetFetch) &&
(event.getRankingResult().getLocalResourceSize() + event.getRankingResult().getRemoteResourceSize() > event.result.size())) {
@@ -533,8 +534,8 @@ public final class plasmaSearchEvent {
this.lastLifeSign = System.currentTimeMillis();
// check if we have enough
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) && (images.size() >= query.neededResults() + fetchAhead)) break;
- if ((query.contentdom != plasmaSearchQuery.CONTENTDOM_IMAGE) && (result.size() >= query.neededResults() + fetchAhead)) break;
+ if ((query.contentdom == Query.CONTENTDOM_IMAGE) && (images.size() >= query.neededResults() + fetchAhead)) break;
+ if ((query.contentdom != Query.CONTENTDOM_IMAGE) && (result.size() >= query.neededResults() + fetchAhead)) break;
// get next entry
page = rankedCache.bestURL(true);
@@ -601,8 +602,8 @@ public final class plasmaSearchEvent {
// we have the wanted result already in the result array .. return that
return this.result.element(item).element;
}
- if ((query.domType == plasmaSearchQuery.SEARCHDOM_GLOBALDHT) ||
- (query.domType == plasmaSearchQuery.SEARCHDOM_CLUSTERALL)) {
+ if ((query.domType == Query.SEARCHDOM_GLOBALDHT) ||
+ (query.domType == Query.SEARCHDOM_CLUSTERALL)) {
// this is a search using remote search threads. Also the local
// search thread is started as background process
if ((localSearchThread != null) && (localSearchThread.isAlive())) {
diff --git a/source/de/anomic/plasma/plasmaSearchRankingProcess.java b/source/de/anomic/plasma/plasmaSearchRankingProcess.java
index d0022938b..5b10757e3 100644
--- a/source/de/anomic/plasma/plasmaSearchRankingProcess.java
+++ b/source/de/anomic/plasma/plasmaSearchRankingProcess.java
@@ -54,6 +54,7 @@ import de.anomic.kelondro.util.SortStack;
import de.anomic.kelondro.util.FileUtils;
import de.anomic.plasma.parser.Word;
import de.anomic.plasma.parser.Condenser;
+import de.anomic.search.Query;
import de.anomic.server.serverProfiling;
import de.anomic.yacy.yacyURL;
@@ -67,7 +68,7 @@ public final class plasmaSearchRankingProcess {
private final SortStack stack;
private final HashMap> doubleDomCache; // key = domhash (6 bytes); value = like stack
private final HashSet handover; // key = urlhash; used for double-check of urls that had been handed over to search process
- private final plasmaSearchQuery query;
+ private final Query query;
private final int maxentries;
private int remote_peerCount, remote_indexCount, remote_resourceSize, local_resourceSize;
private final ReferenceOrder order;
@@ -83,7 +84,7 @@ public final class plasmaSearchRankingProcess {
public plasmaSearchRankingProcess(
final Segment indexSegment,
- final plasmaSearchQuery query,
+ final Query query,
final int maxentries,
final int concurrency) {
// we collect the urlhashes and construct a list with urlEntry objects
@@ -184,11 +185,11 @@ public final class plasmaSearchRankingProcess {
if (!testFlags(iEntry)) continue;
// check document domain
- if (query.contentdom != plasmaSearchQuery.CONTENTDOM_TEXT) {
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_AUDIO) && (!(iEntry.flags().get(Condenser.flag_cat_hasaudio)))) continue;
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_VIDEO) && (!(iEntry.flags().get(Condenser.flag_cat_hasvideo)))) continue;
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) && (!(iEntry.flags().get(Condenser.flag_cat_hasimage)))) continue;
- if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_APP ) && (!(iEntry.flags().get(Condenser.flag_cat_hasapp )))) continue;
+ if (query.contentdom != Query.CONTENTDOM_TEXT) {
+ if ((query.contentdom == Query.CONTENTDOM_AUDIO) && (!(iEntry.flags().get(Condenser.flag_cat_hasaudio)))) continue;
+ if ((query.contentdom == Query.CONTENTDOM_VIDEO) && (!(iEntry.flags().get(Condenser.flag_cat_hasvideo)))) continue;
+ if ((query.contentdom == Query.CONTENTDOM_IMAGE) && (!(iEntry.flags().get(Condenser.flag_cat_hasimage)))) continue;
+ if ((query.contentdom == Query.CONTENTDOM_APP ) && (!(iEntry.flags().get(Condenser.flag_cat_hasapp )))) continue;
}
// check tld domain
@@ -620,10 +621,10 @@ public final class plasmaSearchRankingProcess {
long r = (255 - position) << 8;
// for media search: prefer pages with many links
- if (query.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) r += rentry.limage() << query.ranking.coeff_cathasimage;
- if (query.contentdom == plasmaSearchQuery.CONTENTDOM_AUDIO) r += rentry.laudio() << query.ranking.coeff_cathasaudio;
- if (query.contentdom == plasmaSearchQuery.CONTENTDOM_VIDEO) r += rentry.lvideo() << query.ranking.coeff_cathasvideo;
- if (query.contentdom == plasmaSearchQuery.CONTENTDOM_APP ) r += rentry.lapp() << query.ranking.coeff_cathasapp;
+ if (query.contentdom == Query.CONTENTDOM_IMAGE) r += rentry.limage() << query.ranking.coeff_cathasimage;
+ if (query.contentdom == Query.CONTENTDOM_AUDIO) r += rentry.laudio() << query.ranking.coeff_cathasaudio;
+ if (query.contentdom == Query.CONTENTDOM_VIDEO) r += rentry.lvideo() << query.ranking.coeff_cathasvideo;
+ if (query.contentdom == Query.CONTENTDOM_APP ) r += rentry.lapp() << query.ranking.coeff_cathasapp;
// prefer hit with 'prefer' pattern
if (rentry.url().toNormalform(true, true).matches(query.prefer)) r += 256 << query.ranking.coeff_prefer;
diff --git a/source/de/anomic/plasma/plasmaSearchRankingProfile.java b/source/de/anomic/plasma/plasmaSearchRankingProfile.java
index bb3ab9907..6f5f8f3d4 100644
--- a/source/de/anomic/plasma/plasmaSearchRankingProfile.java
+++ b/source/de/anomic/plasma/plasmaSearchRankingProfile.java
@@ -26,6 +26,8 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import de.anomic.search.Query;
+
public class plasmaSearchRankingProfile {
// pre-sort attributes
@@ -101,11 +103,11 @@ public class plasmaSearchRankingProfile {
coeff_app_dc_subject = 13;
coeff_app_dc_description = 13;
coeff_appemph = 10;
- coeff_catindexof = (mediatype == plasmaSearchQuery.CONTENTDOM_TEXT) ? 0 : 15;
- coeff_cathasimage = (mediatype == plasmaSearchQuery.CONTENTDOM_IMAGE) ? 15 : 0;
- coeff_cathasaudio = (mediatype == plasmaSearchQuery.CONTENTDOM_AUDIO) ? 15 : 0;
- coeff_cathasvideo = (mediatype == plasmaSearchQuery.CONTENTDOM_VIDEO) ? 15 : 0;
- coeff_cathasapp = (mediatype == plasmaSearchQuery.CONTENTDOM_APP) ? 15 : 0;
+ coeff_catindexof = (mediatype == Query.CONTENTDOM_TEXT) ? 0 : 15;
+ coeff_cathasimage = (mediatype == Query.CONTENTDOM_IMAGE) ? 15 : 0;
+ coeff_cathasaudio = (mediatype == Query.CONTENTDOM_AUDIO) ? 15 : 0;
+ coeff_cathasvideo = (mediatype == Query.CONTENTDOM_VIDEO) ? 15 : 0;
+ coeff_cathasapp = (mediatype == Query.CONTENTDOM_APP) ? 15 : 0;
coeff_termfrequency = 14;
coeff_urlcompintoplist = 3;
coeff_descrcompintoplist = 2;
@@ -114,7 +116,7 @@ public class plasmaSearchRankingProfile {
}
public plasmaSearchRankingProfile(final String prefix, final String profile) {
- this(plasmaSearchQuery.CONTENTDOM_TEXT); // set defaults
+ this(Query.CONTENTDOM_TEXT); // set defaults
if ((profile != null) && (profile.length() > 0)) {
//parse external form
final HashMap coeff = new HashMap();
diff --git a/source/de/anomic/plasma/plasmaSnippetCache.java b/source/de/anomic/plasma/plasmaSnippetCache.java
index 280b2f7bf..73bb1ffd8 100644
--- a/source/de/anomic/plasma/plasmaSnippetCache.java
+++ b/source/de/anomic/plasma/plasmaSnippetCache.java
@@ -51,6 +51,7 @@ import de.anomic.plasma.parser.Document;
import de.anomic.plasma.parser.ParserException;
import de.anomic.plasma.parser.Word;
import de.anomic.plasma.parser.Condenser;
+import de.anomic.search.Query;
import de.anomic.yacy.yacySearch;
import de.anomic.yacy.yacyURL;
@@ -707,10 +708,10 @@ public class plasmaSnippetCache {
final plasmaParserDocument document = retrieveDocument(url, fetchOnline, timeout, false, reindexing);
final ArrayList a = new ArrayList();
if (document != null) {
- if ((mediatype == plasmaSearchQuery.CONTENTDOM_ALL) || (mediatype == plasmaSearchQuery.CONTENTDOM_AUDIO)) a.addAll(computeMediaSnippets(document, queryhashes, plasmaSearchQuery.CONTENTDOM_AUDIO));
- if ((mediatype == plasmaSearchQuery.CONTENTDOM_ALL) || (mediatype == plasmaSearchQuery.CONTENTDOM_VIDEO)) a.addAll(computeMediaSnippets(document, queryhashes, plasmaSearchQuery.CONTENTDOM_VIDEO));
- if ((mediatype == plasmaSearchQuery.CONTENTDOM_ALL) || (mediatype == plasmaSearchQuery.CONTENTDOM_APP)) a.addAll(computeMediaSnippets(document, queryhashes, plasmaSearchQuery.CONTENTDOM_APP));
- if ((mediatype == plasmaSearchQuery.CONTENTDOM_ALL) || (mediatype == plasmaSearchQuery.CONTENTDOM_IMAGE)) a.addAll(computeImageSnippets(document, queryhashes));
+ if ((mediatype == Query.CONTENTDOM_ALL) || (mediatype == Query.CONTENTDOM_AUDIO)) a.addAll(computeMediaSnippets(document, queryhashes, Query.CONTENTDOM_AUDIO));
+ if ((mediatype == Query.CONTENTDOM_ALL) || (mediatype == Query.CONTENTDOM_VIDEO)) a.addAll(computeMediaSnippets(document, queryhashes, Query.CONTENTDOM_VIDEO));
+ if ((mediatype == Query.CONTENTDOM_ALL) || (mediatype == Query.CONTENTDOM_APP)) a.addAll(computeMediaSnippets(document, queryhashes, Query.CONTENTDOM_APP));
+ if ((mediatype == Query.CONTENTDOM_ALL) || (mediatype == Query.CONTENTDOM_IMAGE)) a.addAll(computeImageSnippets(document, queryhashes));
}
return a;
}
@@ -719,9 +720,9 @@ public class plasmaSnippetCache {
if (document == null) return new ArrayList();
Map media = null;
- if (mediatype == plasmaSearchQuery.CONTENTDOM_AUDIO) media = document.getAudiolinks();
- else if (mediatype == plasmaSearchQuery.CONTENTDOM_VIDEO) media = document.getVideolinks();
- else if (mediatype == plasmaSearchQuery.CONTENTDOM_APP) media = document.getApplinks();
+ if (mediatype == Query.CONTENTDOM_AUDIO) media = document.getAudiolinks();
+ else if (mediatype == Query.CONTENTDOM_VIDEO) media = document.getVideolinks();
+ else if (mediatype == Query.CONTENTDOM_APP) media = document.getApplinks();
if (media == null) return null;
final Iterator> i = media.entrySet().iterator();
@@ -767,13 +768,13 @@ public class plasmaSnippetCache {
s = removeAppearanceHashes(url.toNormalform(false, false), queryhashes);
if (s.size() == 0) {
final int ranking = ientry.hashCode();
- result.add(new MediaSnippet(plasmaSearchQuery.CONTENTDOM_IMAGE, url, desc, ientry.width() + " x " + ientry.height(), ranking, document.dc_source()));
+ result.add(new MediaSnippet(Query.CONTENTDOM_IMAGE, url, desc, ientry.width() + " x " + ientry.height(), ranking, document.dc_source()));
continue;
}
s = removeAppearanceHashes(desc, s);
if (s.size() == 0) {
final int ranking = ientry.hashCode();
- result.add(new MediaSnippet(plasmaSearchQuery.CONTENTDOM_IMAGE, url, desc, ientry.width() + " x " + ientry.height(), ranking, document.dc_source()));
+ result.add(new MediaSnippet(Query.CONTENTDOM_IMAGE, url, desc, ientry.width() + " x " + ientry.height(), ranking, document.dc_source()));
continue;
}
}
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index 86c03b1a1..6a777739b 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -164,6 +164,7 @@ import de.anomic.plasma.parser.Document;
import de.anomic.plasma.parser.ParserException;
import de.anomic.plasma.parser.Word;
import de.anomic.plasma.parser.Condenser;
+import de.anomic.search.Query;
import de.anomic.server.serverAbstractSwitch;
import de.anomic.server.serverBusyThread;
import de.anomic.server.serverCore;
@@ -246,8 +247,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch localSearches; // array of search result properties as HashMaps
- public ArrayList remoteSearches; // array of search result properties as HashMaps
+ public ArrayList localSearches; // array of search result properties as HashMaps
+ public ArrayList remoteSearches; // array of search result properties as HashMaps
public ConcurrentHashMap> localSearchTracker, remoteSearchTracker; // mappings from requesting host to a TreeSet of Long(access time)
public long indexedPages = 0;
public double requestedQueries = 0d;
@@ -554,8 +555,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch>(); // String:TreeSet - IP:set of Long(accessTime)
this.remoteSearchTracker = new ConcurrentHashMap>();
- this.localSearches = new ArrayList(); // contains search result properties as HashMaps
- this.remoteSearches = new ArrayList();
+ this.localSearches = new ArrayList(); // contains search result properties as HashMaps
+ this.remoteSearches = new ArrayList();
// init messages: clean up message symbol
final File notifierSource = new File(getRootPath(), getConfig(plasmaSwitchboardConstants.HTROOT_PATH, plasmaSwitchboardConstants.HTROOT_PATH_DEFAULT) + "/env/grafics/empty.gif");
@@ -1019,7 +1020,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch queryHashes,
final TreeSet excludeHashes,
final TreeSet fullqueryHashes,
@@ -348,7 +349,7 @@ public final class plasmaSearchQuery {
* @param addToQuery
* @return
*/
- public static String navurl(String ext, final int page, final int display, final plasmaSearchQuery theQuery, final String originalUrlMask, String addToQuery, String nav) {
+ public static String navurl(String ext, final int page, final int display, final Query theQuery, final String originalUrlMask, String addToQuery, String nav) {
return
"/yacysearch." + ext + "?display=" + display +
"&search=" + theQuery.queryString(true) + ((addToQuery == null) ? "" : "+" + addToQuery) +
diff --git a/source/de/anomic/yacy/yacySearch.java b/source/de/anomic/yacy/yacySearch.java
index 91c01a3c4..235f5f449 100644
--- a/source/de/anomic/yacy/yacySearch.java
+++ b/source/de/anomic/yacy/yacySearch.java
@@ -37,9 +37,9 @@ import de.anomic.kelondro.order.Bitfield;
import de.anomic.kelondro.text.Segment;
import de.anomic.kelondro.util.ScoreCluster;
import de.anomic.kelondro.util.Log;
-import de.anomic.plasma.plasmaSearchQuery;
import de.anomic.plasma.plasmaSearchRankingProcess;
import de.anomic.plasma.plasmaSearchRankingProfile;
+import de.anomic.search.Query;
import de.anomic.yacy.dht.PeerSelection;
public class yacySearch extends Thread {
@@ -270,7 +270,7 @@ public class yacySearch extends Thread {
(clusterselection == null) ?
selectSearchTargets(
peers,
- plasmaSearchQuery.hashes2Set(wordhashes),
+ Query.hashes2Set(wordhashes),
targets,
peers.redundancy())
: selectClusterPeers(peers, clusterselection);