From cbb5f06630c2864b540a9b1a7ebe2e2df0bda417 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 27 Aug 2014 00:45:39 +0200 Subject: [PATCH] do not remove the index deletion option from the IndexControlURLs_p.html servlet after a deletion happend, instead show but disable the option when the index is empty. --- htroot/IndexControlURLs_p.html | 10 ++++------ htroot/IndexControlURLs_p.java | 15 ++++++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/htroot/IndexControlURLs_p.html b/htroot/IndexControlURLs_p.html index 74dd8d4b2..148c5009a 100644 --- a/htroot/IndexControlURLs_p.html +++ b/htroot/IndexControlURLs_p.html @@ -93,17 +93,16 @@ function updatepage(str) { - #(cleanup)#::
-
Cleanup + Cleanup
Index Deletion
Delete local search index (embedded Solr and old Metadata)
- #(solr)#:: Delete remote solr index
#(/solr)# - #(rwi)#:: Delete RWI Index (DHT transmission words)
#(/rwi)# - #(citation)#:: Delete Citation Index (linking between URLs)
#(/citation)# + #(cleanupsolr)#:: Delete remote solr index
#(/cleanupsolr)# + #(cleanuprwi)#:: Delete RWI Index (DHT transmission words)
#(/cleanuprwi)# + #(cleanupcitation)#:: Delete Citation Index (linking between URLs)
#(/cleanupcitation)# Delete HTTP & FTP Cache
Stop Crawler and delete Crawl Queues
Delete robots.txt Cache
@@ -113,7 +112,6 @@ function updatepage(str) {
- #(/cleanup)# #(statistics)#::
diff --git a/htroot/IndexControlURLs_p.java b/htroot/IndexControlURLs_p.java index dcae6e585..345d35bed 100644 --- a/htroot/IndexControlURLs_p.java +++ b/htroot/IndexControlURLs_p.java @@ -65,7 +65,8 @@ public class IndexControlURLs_p { final serverObjects prop = new serverObjects(); Segment segment = sb.index; - + long ucount = segment.fulltext().collectionSize(); + // set default values prop.put("urlstring", ""); prop.put("urlhash", ""); @@ -83,10 +84,10 @@ public class IndexControlURLs_p { List dumpFiles = segment.fulltext().dumpFiles(); prop.put("dumprestore_dumpfile", dumpFiles.size() == 0 ? "" : dumpFiles.get(dumpFiles.size() - 1).getAbsolutePath()); prop.put("dumprestore_optimizemax", 10); - prop.put("cleanup", post == null || post.size() == 0 ? 1 : 0); - prop.put("cleanup_solr", segment.fulltext().connectedRemoteSolr() ? 1 : 0); - prop.put("cleanup_rwi", segment.termIndex() != null && !segment.termIndex().isEmpty() ? 1 : 0); - prop.put("cleanup_citation", segment.connectedCitation() && !segment.urlCitation().isEmpty() ? 1 : 0); + prop.put("cleanup", ucount == 0 ? 0 : 1); + prop.put("cleanupsolr", segment.fulltext().connectedRemoteSolr() ? 1 : 0); + prop.put("cleanuprwi", segment.termIndex() != null && !segment.termIndex().isEmpty() ? 1 : 0); + prop.put("cleanupcitation", segment.connectedCitation() && !segment.urlCitation().isEmpty() ? 1 : 0); // show export messages final Fulltext.Export export = segment.fulltext().export(); @@ -121,7 +122,7 @@ public class IndexControlURLs_p { } if (post == null || env == null) { - prop.putNum("ucount", segment.fulltext().collectionSize()); + prop.putNum("ucount", ucount); return prop; // nothing to do } @@ -337,7 +338,7 @@ public class IndexControlURLs_p { } // insert constants - prop.putNum("ucount", segment.fulltext().collectionSize()); + prop.putNum("ucount", ucount); // return rewrite properties return prop; }