a cache access shall not made directly to the cache any more, all loading attempts shall use the LoaderDispatcher.
To control the usage of the cache, a enum instance from CrawlProfile.CacheStrategy shall be used.
Some direct loading methods without the usage of a cache strategy have been removed. This affects also the verify-option
of the yacysearch servlet. If there is a 'verify=false' now after this commit this does not necessarily mean that no snippets
are generated. Instead, all snippets that can be retrieved using the cache only are presented. This still means that the search hit was not verified because the snippet was generated using the cache. If a cache-based generation of snippets is not possible, then the verify=false causes that the link is not rejected.
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6936 6c8d7289-2bf4-0310-a012-ef5d649a1542
booleannewsearch=post.hasValue("query")&&post.hasValue("former")&&!post.get("query","").equalsIgnoreCase(post.get("former",""));//new search term
intitemsPerPage=Math.min((authenticated)?(fetchSnippets ?100:1000):(fetchSnippets?10:100),post.getInt("maximumRecords",post.getInt("count",10)));// SRU syntax with old property as alternative
intitemsPerPage=Math.min((authenticated)?(snippetFetchStrategy.isAllowedToFetchOnline()?100:1000):(snippetFetchStrategy.isAllowedToFetchOnline()?10:100),post.getInt("maximumRecords",post.getInt("count",10)));// SRU syntax with old property as alternative
Log.logWarning("LOCAL_SEARCH","ACCECC CONTROL: CLIENT FROM "+client+": "+accInTenMinutes+" searches in ten minutes, fully blocked (no results generated)");
Log.logWarning("LOCAL_SEARCH","ACCECC CONTROL: CLIENT FROM "+client+": "+accInOneMinute+" searches in one minute, fully blocked (no results generated)");
Log.logWarning("LOCAL_SEARCH","ACCECC CONTROL: CLIENT FROM "+client+": "+accInThreeSeconds+" searches in three seconds, blocked global search and snippets");
Log.logWarning("LOCAL_SEARCH","ACCECC CONTROL: CLIENT FROM "+client+": "+accInOneSecond+" searches in one second, blocked global search and snippets");
Log.logInfo("SEARCH","text snippet load time for "+metadata.url()+": "+snippetComputationTime+", "+((snippet.getErrorCode()<11)?"snippet found":("no snippet found ("+snippet.getError()+")")));
@ -232,26 +233,26 @@ public class ResultFetcher {
if(snippet.getErrorCode()<11){
// we loaded the file and found the snippet
returnnewResultEntry(page,query.getSegment(),peers,snippet,null,dbRetrievalTime,snippetComputationTime);// result with snippet attached
}elseif(snippetMode ==1){
}elseif(cacheStrategy.mustBeOffline()){
// we did not demand online loading, therefore a failure does not mean that the missing snippet causes a rejection of this result
// this may happen during a remote search, because snippet loading is omitted to retrieve results faster
returnnewResultEntry(page,query.getSegment(),peers,null,null,dbRetrievalTime,snippetComputationTime);// result without snippet
}else{
// problems with snippet fetch
registerFailure(page.hash(),"no text snippet for URL "+metadata.url());
registerFailure(page.hash(),"no text snippet for URL "+metadata.url()+"; errorCode = "+snippet.getErrorCode());