|
|
@ -36,34 +36,49 @@ public class IndexReIndexMonitor_p {
|
|
|
|
prop.put("docsprocessed", "0");
|
|
|
|
prop.put("docsprocessed", "0");
|
|
|
|
prop.put("currentselectquery","");
|
|
|
|
prop.put("currentselectquery","");
|
|
|
|
BusyThread bt = sb.getThread("reindexSolr");
|
|
|
|
BusyThread bt = sb.getThread("reindexSolr");
|
|
|
|
|
|
|
|
if (bt == null) {
|
|
|
|
|
|
|
|
if (post != null && post.containsKey("reindexnow") && sb.index.fulltext().connectedLocalSolr()) {
|
|
|
|
|
|
|
|
migration.reindexToschema(sb);
|
|
|
|
|
|
|
|
prop.put("querysize", "0");
|
|
|
|
|
|
|
|
prop.put("infomessage","reindex job started");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bt = sb.getThread("reindexSolr"); //get new created job for following posts
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (bt != null) {
|
|
|
|
if (bt != null) {
|
|
|
|
|
|
|
|
prop.put("reindexjobrunning", 1);
|
|
|
|
prop.put("querysize", bt.getJobCount());
|
|
|
|
prop.put("querysize", bt.getJobCount());
|
|
|
|
|
|
|
|
|
|
|
|
if (bt instanceof ReindexSolrBusyThread) {
|
|
|
|
if (bt instanceof ReindexSolrBusyThread) {
|
|
|
|
prop.put("docsprocessed", ((ReindexSolrBusyThread) bt).getProcessed());
|
|
|
|
prop.put("docsprocessed", ((ReindexSolrBusyThread) bt).getProcessed());
|
|
|
|
prop.put("currentselectquery","q="+((ReindexSolrBusyThread) bt).getCurrentQuery());
|
|
|
|
prop.put("currentselectquery","q="+((ReindexSolrBusyThread) bt).getCurrentQuery());
|
|
|
|
|
|
|
|
// prepare list of fields in queue
|
|
|
|
|
|
|
|
final String[] querylist = ((ReindexSolrBusyThread) bt).getQueryList();
|
|
|
|
|
|
|
|
if (querylist != null) {
|
|
|
|
|
|
|
|
String allfieldnames = "";
|
|
|
|
|
|
|
|
for (String oneqs : querylist) { // just use fieldname from query (fieldname:[* TO *])
|
|
|
|
|
|
|
|
allfieldnames = allfieldnames + oneqs.substring(0, oneqs.indexOf(':')) + "<br> ";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
prop.put("reindexjobrunning_fieldlist", allfieldnames);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
prop.put("reindexjobrunning_fieldlist", "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (post != null && post.containsKey("stopreindex")) {
|
|
|
|
if (post != null && post.containsKey("stopreindex")) {
|
|
|
|
sb.terminateThread("reindexSolr", false);
|
|
|
|
sb.terminateThread("reindexSolr", false);
|
|
|
|
prop.put("infomessage", "reindex job stopped");
|
|
|
|
prop.put("infomessage", "reindex job stopped");
|
|
|
|
prop.put("showstartbutton", 1);
|
|
|
|
prop.put("reindexjobrunning",0);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
prop.put("infomessage", "reindex is running");
|
|
|
|
prop.put("infomessage", "reindex is running");
|
|
|
|
prop.put("showstartbutton", 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (post != null && post.containsKey("reindexnow") && sb.index.fulltext().connectedLocalSolr()) {
|
|
|
|
prop.put("reindexjobrunning", 0);
|
|
|
|
migration.reindexToschema(sb);
|
|
|
|
|
|
|
|
prop.put("showstartbutton", 0);
|
|
|
|
|
|
|
|
prop.put("querysize", "0");
|
|
|
|
|
|
|
|
prop.put("infomessage","reindex job started");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
prop.put("showstartbutton", 1);
|
|
|
|
|
|
|
|
prop.put("querysize", "is empty");
|
|
|
|
prop.put("querysize", "is empty");
|
|
|
|
prop.put("infomessage", "no reindex job running");
|
|
|
|
prop.put("infomessage", "no reindex job running");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// return rewrite properties
|
|
|
|
// return rewrite properties
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|