From cb2c25d93085524184b561d00563a4f308cf9ca0 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 11 Feb 2014 22:02:10 +0100 Subject: [PATCH] in case that the crawler is running and the search user is the peer admin, we expect that the user wants to check recently crawled document to ensure that recent crawl results are inside the search results, we do a soft commit here. --- htroot/yacysearch.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 3c8a83ef0..eac4365b2 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -113,6 +113,12 @@ public class yacysearch { "") : env.getConfig(SwitchboardConstants.GREETING, ""); final String client = header.get(HeaderFramework.CONNECTION_PROP_CLIENTIP); // the search client who initiated the search + // in case that the crawler is running and the search user is the peer admin, we expect that the user wants to check recently crawled document + // to ensure that recent crawl results are inside the search results, we do a soft commit here. This is also important for live demos! + if (authenticated && sb.getThread(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL).getJobCount() > 0) { + sb.index.fulltext().commit(true); + } + // get query final String originalquerystring = (post == null) ? "" : post.get("query", post.get("search", "")).trim(); String querystring = originalquerystring.replace('+', ' ').trim();