Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fixed some bugs for auto-filter and added monitor in profile list

orbiter708cc6c8d9b5
diff --git a/htroot/IndexCreate_p.html b/htroot/IndexCreate_p.html
index 0d5a82ba1..d1b4efea0 100644
--- a/htroot/IndexCreate_p.html
+++ b/htroot/IndexCreate_p.html
@@ -272,6 +272,10 @@ Continue crawling.
<td class="small"><b>Start URL</b></td>
<td width="16" class="small"><b>Depth</b></td>
<td width="60" class="small"><b>Filter</b></td>
+ <td width="10" class="small"><b>MaxAge</b></td>
+ <td width="10" class="small"><b>Auto Filter Depth</b></td>
+ <td class="small"><b>Auto Filter Content</b></td>
+ <td width="10" class="small"><b>Max Page Per Domain</b></td>
<td width="10" class="small"><b>Accept "?" URLs</b></td>
<td width="10" class="small"><b>Fill Proxy Cache</b></td>
<td width="10" class="small"><b>Local Indexing</b></td>
@@ -283,6 +287,10 @@ Continue crawling.
<td class="small"><a class="small" href="#[startURL]#">#[startURL]#</a></td>
<td class="small">#[depth]#</td>
<td class="small">#[filter]#</td>
+ <td class="small">#[crawlingIfOlder]#</td>
+ <td class="small">#[crawlingDomFilterDepth]#</td>
+ <td class="small">#[crawlingDomFilterContent]#</td>
+ <td class="small">#[crawlingDomMaxPages]#</td>
<td class="small">#(withQuery)#no::yes#(/withQuery)#</td>
<td class="small">#(storeCache)#no::yes#(/storeCache)#</td>
<td class="small">#(localIndexing)#no::yes#(/localIndexing)#</td>
diff --git a/htroot/IndexCreate_p.java b/htroot/IndexCreate_p.java
index e53914190..31eed73cf 100644
--- a/htroot/IndexCreate_p.java
+++ b/htroot/IndexCreate_p.java
@@ -95,11 +95,11 @@ public class IndexCreate_p {
env.setConfig("crawlingFilter", newcrawlingfilter);
int newcrawlingdepth = Integer.parseInt(post.get("crawlingDepth", "0"));
env.setConfig("crawlingDepth", Integer.toString(newcrawlingdepth));
- int recrawlIfOlder = Integer.parseInt(post.get("recrawlIfOlder", "-1"));
+ int recrawlIfOlder = Integer.parseInt(post.get("crawlingIfOlder", "-1"));
env.setConfig("crawlingIfOlder", recrawlIfOlder);
- int domFilterDepth = Integer.parseInt(post.get("domFilterDepth", "-1"));
+ int domFilterDepth = Integer.parseInt(post.get("crawlingDomFilterDepth", "-1"));
env.setConfig("crawlingDomFilterDepth", Integer.toString(domFilterDepth));
- int domMaxPages = Integer.parseInt(post.get("domMaxPages", "-1"));
+ int domMaxPages = Integer.parseInt(post.get("crawlingDomMaxPages", "-1"));
env.setConfig("crawlingDomMaxPages", Integer.toString(domMaxPages));
boolean crawlingQ = post.get("crawlingQ", "").equals("on");
env.setConfig("crawlingQ", (crawlingQ) ? "true" : "false");
@@ -353,6 +353,8 @@ public class IndexCreate_p {
Iterator it = switchboard.profiles.profiles(true);
plasmaCrawlProfile.entry profile;
dark = true;
+ Iterator domnamesi;
+ String domnames;
while (it.hasNext()) {
profile = (plasmaCrawlProfile.entry) it.next();
//table += profile.map().toString() + "<br>";
@@ -362,6 +364,12 @@ public class IndexCreate_p {
prop.put("crawlProfiles_"+count+"_handle", wikiCode.replaceHTML(profile.handle()));
prop.put("crawlProfiles_"+count+"_depth", profile.generalDepth());
prop.put("crawlProfiles_"+count+"_filter", profile.generalFilter());
+ prop.put("crawlProfiles_"+count+"_crawlingIfOlder", (profile.recrawlIfOlder() == Long.MAX_VALUE) ? "no re-crawl" : ""+profile.recrawlIfOlder());
+ prop.put("crawlProfiles_"+count+"_crawlingDomFilterDepth", (profile.domFilterDepth() == Integer.MAX_VALUE) ? "inactive" : ""+profile.domFilterDepth());
+ domnamesi = profile.domNames();
+ domnames=""; while (domnamesi.hasNext()) domnames += ((String) domnamesi.next()) + ", ";
+ prop.put("crawlProfiles_"+count+"_crawlingDomFilterContent", domnames);
+ prop.put("crawlProfiles_"+count+"_crawlingDomMaxPages", (profile.domMaxPages() == Integer.MAX_VALUE) ? "unlimited" : ""+profile.domMaxPages());
prop.put("crawlProfiles_"+count+"_withQuery", ((profile.crawlingQ()) ? 1 : 0));
prop.put("crawlProfiles_"+count+"_storeCache", ((profile.storeHTCache()) ? 1 : 0));
prop.put("crawlProfiles_"+count+"_localIndexing", ((profile.localIndexing()) ? 1 : 0));
diff --git a/source/de/anomic/plasma/plasmaCrawlProfile.java b/source/de/anomic/plasma/plasmaCrawlProfile.java
index db88aed0f..31b6fd7b6 100644
--- a/source/de/anomic/plasma/plasmaCrawlProfile.java
+++ b/source/de/anomic/plasma/plasmaCrawlProfile.java
@@ -57,6 +57,7 @@ import de.anomic.server.serverCodings;
public class plasmaCrawlProfile {
private kelondroMap profileTable;
+ private HashMap domsCache;
private File profileTableFile;
private int bufferkb;
@@ -73,6 +74,7 @@ public class plasmaCrawlProfile {
dyn = new kelondroDyn(file, bufferkb * 1024, plasmaURL.urlCrawlProfileHandleLength, 2000, '#', true);
}
profileTable = new kelondroMap(dyn);
+ domsCache = new HashMap();
}
public int[] dbCacheChunkSize() {
@@ -270,7 +272,8 @@ public class plasmaCrawlProfile {
public entry(Map mem) {
this.mem = mem;
- this.doms = new HashMap();
+ this.doms = (HashMap) domsCache.get(this.mem.get("handle"));
+ if (this.doms == null) this.doms = new HashMap();
}
public Map map() {
@@ -393,6 +396,7 @@ public class plasmaCrawlProfile {
// increase counter
doms.put(domain, new Integer(c.intValue() + 1));
}
+ domsCache.put(this.mem.get("handle"), doms);
}
public int domCount(String domain) {
Integer c = (Integer) doms.get(domain);