do the commit anyway before calling a search interface

This commit is contained in:
Michael Peter Christen 2012-11-07 17:27:50 +01:00
parent 842faf96a2
commit 61995d508e
4 changed files with 6 additions and 4 deletions

View File

@ -84,7 +84,7 @@ public class HostBrowser {
}
String path = post == null ? "" : post.get("path", "").trim();
if (admin && path.length() == 0 && sb.crawler.getActiveSize() > 0) sb.index.fulltext().commit();
if (admin && path.length() == 0) sb.index.fulltext().commit();
if (post == null || env == null) {
return prop;
}

View File

@ -62,7 +62,7 @@ public class index {
}
}
if (authorizedAccess && sb.crawler.getActiveSize() > 0) {
if (authorizedAccess) {
sb.index.fulltext().commit(); // call this only as superuser to prevent that this can be misused for DoS
}

View File

@ -48,7 +48,9 @@ public class yacyinteractive {
prop.put("promoteSearchPageGreeting.smallImage", sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
final boolean admin = sb.verifyAuthentication(header);
if (admin && sb.crawler.getActiveSize() > 0) sb.index.fulltext().commit();
if (admin) {
sb.index.fulltext().commit();
}
final String query = (post == null) ? "" : post.get("query", "");
final String startRecord = (post == null) ? "0" : post.get("startRecord", "");

View File

@ -116,7 +116,7 @@ public class yacysearch {
final String originalquerystring = (post == null) ? "" : post.get("query", post.get("search", "")).trim();
String querystring = originalquerystring.replace('+', ' ').replace('*', ' ').trim();
CacheStrategy snippetFetchStrategy = (post == null) ? null : CacheStrategy.parse(post.get("verify", "cacheonly"));
if (authenticated && originalquerystring.length() == 0 && sb.crawler.getActiveSize() > 0) sb.index.fulltext().commit();
if (authenticated && originalquerystring.length() == 0) sb.index.fulltext().commit();
final servletProperties prop = new servletProperties();
prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);