add admin option to delete load errors from index

pull/1/head
reger 12 years ago
parent 518b20147c
commit 0f4237d8e5

@ -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%#

@ -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

@ -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)#
Loading…
Cancel
Save