Skip to content

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

add admin option to delete load errors from index

reger0f4237d8e59b
diff --git a/htroot/HostBrowser.html b/htroot/HostBrowser.html
index 9f7d1bbca..9e9412061 100644
--- a/htroot/HostBrowser.html
+++ b/htroot/HostBrowser.html
@@ -96,7 +96,7 @@ function updatepage(str) {
<div class="commit" style="float:left;">&nbsp;&nbsp;&nbsp;Documents without Errors</div>
<div class="pending" style="float:left;">&nbsp;&nbsp;&nbsp;Pending in Crawler</div>
<div class="error" style="float:left;">&nbsp;&nbsp;&nbsp;Load Errors (exclusion/failure)</div>
- </div>
+ </div>
</fieldset>
#(/hosts)#
@@ -174,13 +174,9 @@ function updatepage(str) {
#{/list}#
</fieldset>
#(/inbound)#
-
- #(admin)#::
- <form action="HostBrowser.html" method="get">
- <fieldset><legend>Administration Options</legend>
- </fieldset>
- </form>
+ #(admin)#::
+ #%HostBrowserAdmin_p.html%#
#(/admin)#
#%env/templates/footer.template%#
diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java
index 46cb8e42a..1f60e8e0b 100644
--- a/htroot/HostBrowser.java
+++ b/htroot/HostBrowser.java
@@ -82,7 +82,7 @@ public class HostBrowser {
prop.putNum("ucount", fulltext.collectionSize());
prop.put("hosts", 0);
prop.put("files", 0);
- prop.put("admin", 0);
+ prop.put("admin", admin ? 1 : 0);
if (admin) { // show top nav to admins
prop.put("topmenu",1);
@@ -143,6 +143,21 @@ public class HostBrowser {
prop.put("result", "bad url '" + load + "'");
}
}
+
+ if (admin && post.containsKey("deleteLoadErrors")) {
+ try {
+ fulltext.getDefaultConnector().deleteByQuery("-" + CollectionSchema.httpstatus_i.getSolrFieldName() + ":200 AND "
+ + CollectionSchema.httpstatus_i.getSolrFieldName() + ":[* TO *]"); // make sure field exists
+ Log.logInfo ("HostBrowser:", "delete documents with httpstatus_i <> 200");
+ fulltext.getDefaultConnector().deleteByQuery(CollectionSchema.failtype_s.getSolrFieldName() + ":\"" + FailType.fail.name() + "\"" );
+ Log.logInfo ("HostBrowser:", "delete documents with failtype_s = fail");
+ fulltext.getDefaultConnector().deleteByQuery(CollectionSchema.failtype_s.getSolrFieldName() + ":\"" + FailType.excl.name() + "\"" );
+ Log.logInfo ("HostBrowser:", "delete documents with failtype_s = excl");
+ return prop;
+ } catch (IOException ex) {
+ Log.logException(ex);
+ }
+ }
if (post.containsKey("hosts")) {
// generate host list
diff --git a/htroot/HostBrowserAdmin_p.html b/htroot/HostBrowserAdmin_p.html
new file mode 100644
index 000000000..fcb5d6e92
--- /dev/null
+++ b/htroot/HostBrowserAdmin_p.html
@@ -0,0 +1,12 @@
+
+ #(hosts)#::
+ <form action="HostBrowser.html" method="get">
+ <fieldset><legend>Administration Options</legend>
+ <dl>
+ <dd>
+ <div>Delete all <spawn class="error">Load Errors</spawn> from index <input style="width:240px " type="submit" name="deleteLoadErrors" value="Delete Load Errors" class="submitready"/></div>
+ </dd>
+ </dl>
+ </fieldset>
+ </form>
+ #(/hosts)#