moved the index deletion functions from IndexControlRWIs to

IndexControlURLs where it appears more naturally. Because the RWI
administration is less important in the presence of Solr, the
IndexControlURL is now the default servlet when the Index Administration
button on the main menu is selected.
pull/1/head
Michael Peter Christen 12 years ago
parent ae246c30c3
commit 941873fba4

@ -24,30 +24,9 @@
</dd>
</dl>
</fieldset>
#(cleanup)#::
</form>
<form action="IndexControlRWIs_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Cleanup</legend>
<dl>
<dt class="TableCellDark">Index Deletion</dt>
<dd><input type="checkbox" name="deleteIndex" id="deleteIndex"
onclick="x=document.getElementById('deleteIndex').checked;document.getElementById('deleteTriplestore').checked=x;document.getElementById('deleteRobots').checked=x;document.getElementById('deleteRobots').checked=x;document.getElementById('deleteCrawlQueues').checked=x;c='disabled';document.getElementById('deleteSearchFl').checked=x;if(x){c='';}document.getElementById('deleteTriplestore').disabled=c;document.getElementById('deletecomplete').disabled=c;document.getElementById('deleteCache').disabled=c;document.getElementById('deleteRobots').disabled=c;document.getElementById('deleteCrawlQueues').disabled=c;document.getElementById('deleteSearchFl').disabled=c;"
/><label for="deleteIndex">Delete local search index (including local RWI, Metadata and embedded solr)</label><br/>
#(solr)#::<input type="checkbox" name="deleteRemoteSolr" id="deleteRemoteSolr"
onclick="x=document.getElementById('deleteRemoteSolr').checked;document.getElementById('deleteRobots').checked=x;document.getElementById('deleteCrawlQueues').checked=x;c='disabled';document.getElementById('deleteSearchFl').checked=x;if(x){c='';}document.getElementById('deletecomplete').disabled=c;document.getElementById('deleteCache').disabled=c;document.getElementById('deleteRobots').disabled=c;document.getElementById('deleteCrawlQueues').disabled=c;document.getElementById('deleteSearchFl').disabled=c;"
/><label for="deleteRemoteSolr">Delete remote solr index</label><br/>#(/solr)#
<input type="checkbox" name="deleteTriplestore" id="deleteTriplestore" disabled="disabled" /><label for="deleteTriplestore">Delete RDF Triplestore</label><br/>
<input type="checkbox" name="deleteCache" id="deleteCache" disabled="disabled" /><label for="deleteCache">Delete HTTP &amp; FTP Cache</label><br/>
<input type="checkbox" name="deleteCrawlQueues" id="deleteCrawlQueues" disabled="disabled" /><label for="deleteCrawlQueues">Stop Crawler and delete Crawl Queues</label><br/>
<input type="checkbox" name="deleteRobots" id="deleteRobots" disabled="disabled" /><label for="deleteRobots">Delete robots.txt Cache</label><br/>
<input type="checkbox" name="deleteSearchFl" id="deleteSearchFl" disabled="disabled" /><label for="deleteSearchFl">Delete cached snippet-fetching failures during search</label><br/><br/>
<input type="submit" name="deletecomplete" id="deletecomplete" value="Delete" disabled="disabled" class="submitready" style="width:240px;"/>
</dd>
</dl>
</fieldset>
</form>
</form>
#(limitations)#::
<form action="IndexControlRWIs_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Limitations</legend>
<dl>
@ -61,7 +40,7 @@
</dl>
</fieldset>
</form>
#(/cleanup)#
#(/limitations)#
#(searchresult)#::
<p>No entry for word '#[word]#'</p>::

@ -38,15 +38,11 @@ import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.lod.JenaTripleStore;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.storage.HandleSet;
import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.data.ResultURLs;
import net.yacy.data.ListManager;
import net.yacy.data.WorkTables;
import net.yacy.document.Condenser;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadata;
@ -81,10 +77,7 @@ public class IndexControlRWIs_p {
private final static String errmsg = "not possible to compute word from hash";
public static serverObjects respond(
@SuppressWarnings("unused") final RequestHeader header,
final serverObjects post,
final serverSwitch env) throws IOException {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) {
// return variable that accumulates replacements
final Switchboard sb = (Switchboard) env;
final serverObjects prop = new serverObjects();
@ -93,8 +86,7 @@ public class IndexControlRWIs_p {
prop.putHTML("keystring", "");
prop.put("keyhash", "");
prop.put("result", "");
prop.put("cleanup", post == null || post.containsKey("maxReferencesLimit") ? 1 : 0);
prop.put("cleanup_solr", sb.index.fulltext().connectedRemoteSolr() ? 1 : 0);
prop.put("limitations", post == null || post.containsKey("maxReferencesLimit") ? 1 : 0);
// switch off all optional forms/lists
prop.put("searchresult", 0);
@ -154,38 +146,6 @@ public class IndexControlRWIs_p {
}
}
// delete everything
if ( post.containsKey("deletecomplete") ) {
if ( post.get("deleteIndex", "").equals("on") ) {
segment.clear();
}
if ( post.get("deleteRemoteSolr", "").equals("on")) {
try {
sb.index.fulltext().getSolr().clear();
} catch ( final Exception e ) {
Log.logException(e);
}
}
if ( post.get("deleteCrawlQueues", "").equals("on") ) {
sb.crawlQueues.clear();
sb.crawlStacker.clear();
ResultURLs.clearStacks();
}
if ( post.get("deleteTriplestore", "").equals("on") ) {
JenaTripleStore.clear();
}
if ( post.get("deleteCache", "").equals("on") ) {
Cache.clear();
}
if ( post.get("deleteRobots", "").equals("on") ) {
sb.robots.clear();
}
if ( post.get("deleteSearchFl", "").equals("on") ) {
sb.tables.clear(WorkTables.TABLE_SEARCH_FAILURE_NAME);
}
post.remove("deletecomplete");
}
// set reference limitation
if ( post.containsKey("maxReferencesLimit") ) {
if ( post.get("maxReferencesRadio", "").equals("on") ) {
@ -490,10 +450,8 @@ public class IndexControlRWIs_p {
// insert constants
prop.putNum("wcount", segment.RWICount());
prop.put("cleanup_maxReferencesRadioChecked", ReferenceContainer.maxReferences > 0 ? 1 : 0);
prop.put("cleanup_maxReferences", ReferenceContainer.maxReferences > 0
? ReferenceContainer.maxReferences
: 100000);
prop.put("limitations_maxReferencesRadioChecked", ReferenceContainer.maxReferences > 0 ? 1 : 0);
prop.put("limitations_maxReferences", ReferenceContainer.maxReferences > 0 ? ReferenceContainer.maxReferences : 100000);
// return rewrite properties
return prop;

@ -83,7 +83,28 @@ function updatepage(str) {
</fieldset>
</form>
#(cleanup)#::
<form action="IndexControlURLs_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Cleanup</legend>
<dl>
<dt class="TableCellDark">Index Deletion</dt>
<dd><input type="checkbox" name="deleteIndex" id="deleteIndex"
onclick="x=document.getElementById('deleteIndex').checked;document.getElementById('deleteTriplestore').checked=x;document.getElementById('deleteRobots').checked=x;document.getElementById('deleteRobots').checked=x;document.getElementById('deleteCrawlQueues').checked=x;c='disabled';document.getElementById('deleteSearchFl').checked=x;if(x){c='';}document.getElementById('deleteTriplestore').disabled=c;document.getElementById('deletecomplete').disabled=c;document.getElementById('deleteCache').disabled=c;document.getElementById('deleteRobots').disabled=c;document.getElementById('deleteCrawlQueues').disabled=c;document.getElementById('deleteSearchFl').disabled=c;"
/><label for="deleteIndex">Delete local search index (including local RWI, Metadata and embedded solr)</label><br/>
#(solr)#::<input type="checkbox" name="deleteRemoteSolr" id="deleteRemoteSolr"
onclick="x=document.getElementById('deleteRemoteSolr').checked;document.getElementById('deleteRobots').checked=x;document.getElementById('deleteCrawlQueues').checked=x;c='disabled';document.getElementById('deleteSearchFl').checked=x;if(x){c='';}document.getElementById('deletecomplete').disabled=c;document.getElementById('deleteCache').disabled=c;document.getElementById('deleteRobots').disabled=c;document.getElementById('deleteCrawlQueues').disabled=c;document.getElementById('deleteSearchFl').disabled=c;"
/><label for="deleteRemoteSolr">Delete remote solr index</label><br/>#(/solr)#
<input type="checkbox" name="deleteTriplestore" id="deleteTriplestore" disabled="disabled" /><label for="deleteTriplestore">Delete RDF Triplestore</label><br/>
<input type="checkbox" name="deleteCache" id="deleteCache" disabled="disabled" /><label for="deleteCache">Delete HTTP &amp; FTP Cache</label><br/>
<input type="checkbox" name="deleteCrawlQueues" id="deleteCrawlQueues" disabled="disabled" /><label for="deleteCrawlQueues">Stop Crawler and delete Crawl Queues</label><br/>
<input type="checkbox" name="deleteRobots" id="deleteRobots" disabled="disabled" /><label for="deleteRobots">Delete robots.txt Cache</label><br/>
<input type="checkbox" name="deleteSearchFl" id="deleteSearchFl" disabled="disabled" /><label for="deleteSearchFl">Delete cached snippet-fetching failures during search</label><br/><br/>
<input type="submit" name="deletecomplete" id="deletecomplete" value="Delete" disabled="disabled" class="submitready" style="width:240px;"/>
</dd>
</dl>
</fieldset>
</form>
#(/cleanup)#
#(statistics)#::
<form action="IndexControlURLs_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">

@ -34,8 +34,12 @@ import java.util.List;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.lod.JenaTripleStore;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.data.ResultURLs;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadata;
import net.yacy.kelondro.data.word.Word;
@ -74,6 +78,8 @@ public class IndexControlURLs_p {
prop.put("dumprestore", 1);
List<File> dumpFiles = segment.fulltext().dumpFiles();
prop.put("dumprestore_dumpfile", dumpFiles.size() == 0 ? "" : dumpFiles.get(dumpFiles.size() - 1).getAbsolutePath());
prop.put("cleanup", post == null ? 1 : 0);
prop.put("cleanup_solr", sb.index.fulltext().connectedRemoteSolr() ? 1 : 0);
// show export messages
final Fulltext.Export export = segment.fulltext().export();
@ -131,6 +137,38 @@ public class IndexControlURLs_p {
prop.putHTML("urlhash", urlhash);
prop.put("result", " ");
// delete everything
if ( post.containsKey("deletecomplete") ) {
if ( post.get("deleteIndex", "").equals("on") ) {
segment.clear();
}
if ( post.get("deleteRemoteSolr", "").equals("on")) {
try {
sb.index.fulltext().getSolr().clear();
} catch ( final Exception e ) {
Log.logException(e);
}
}
if ( post.get("deleteCrawlQueues", "").equals("on") ) {
sb.crawlQueues.clear();
sb.crawlStacker.clear();
ResultURLs.clearStacks();
}
if ( post.get("deleteTriplestore", "").equals("on") ) {
JenaTripleStore.clear();
}
if ( post.get("deleteCache", "").equals("on") ) {
Cache.clear();
}
if ( post.get("deleteRobots", "").equals("on") ) {
try {sb.robots.clear();} catch (IOException e) {}
}
if ( post.get("deleteSearchFl", "").equals("on") ) {
sb.tables.clear(WorkTables.TABLE_SEARCH_FAILURE_NAME);
}
post.remove("deletecomplete");
}
if (post.containsKey("urlhashdeleteall")) {
int i = segment.removeAllUrlReferences(urlhash.getBytes(), sb.loader, CacheStrategy.IFEXIST);
prop.put("result", "Deleted URL and " + i + " references from " + i + " word indexes.");

@ -30,7 +30,7 @@
<ul class="menu">
<li><a href="/CrawlStartSite_p.html" class="MenuItemLink lock">Crawler / Harvester</a></li>
<li><a href="/Crawler_p.html" class="MenuItemLink lock">Creation Monitor</a></li>
<li><a href="/IndexControlRWIs_p.html" class="MenuItemLink lock">Index Administration</a></li>
<li><a href="/IndexControlURLs_p.html" class="MenuItemLink lock">Index Administration</a></li>
<li><a href="/Blacklist_p.html" class="MenuItemLink lock">Filter &amp; Blacklists</a></li>
<li><a href="/Vocabulary_p.html" class="MenuItemLink lock">Content Semantic</a></li>
</ul>

@ -1,8 +1,8 @@
<div class="SubMenu">
<h3>Index Administration</h3>
<ul class="SubMenu">
<li><a href="/IndexControlRWIs_p.html" class="MenuItemLink lock">Reverse Word Index Administration</a></li>
<li><a href="/IndexControlURLs_p.html" class="MenuItemLink lock">URL References Database</a></li>
<li><a href="/IndexControlRWIs_p.html" class="MenuItemLink lock">Reverse Word Index Administration</a></li>
<!--<li><a href="/IndexControlCleaner_p.html" class="MenuItemLink lock">Index Cleaner</a></li>-->
<li><a href="/ViewFile.html?display=1" class="MenuItemLink">URL Viewer</a></li>
<li><a href="/IndexFederated_p.html" class="MenuItemLink lock">Federated Index</a></li>

Loading…
Cancel
Save