SearchEvent.log.info("text snippet load time for "+page.url().toNormalform(true)+": "+snippetComputationTime+", "+(!snippet.getErrorCode().fail()?"snippet found":("no snippet found ("+snippet.getError()+")")));
SearchEvent.log.info("text snippet load time for "+page.url().toNormalform(true)+": "+(System.currentTimeMillis()-startTime)+" ms, "+(!snippet.getErrorCode().fail()?"snippet found":("no snippet found ("+snippet.getError()+")")));
if(!snippet.getErrorCode().fail()){
// we loaded the file and found the snippet
returnnewResultEntry(page,this.query.getSegment(),this.peers,snippet, snippetComputationTime);// result with snippet attached
returnnewResultEntry(page,this.query.getSegment(),this.peers,snippet);// result with snippet attached
}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,this.query.getSegment(),this.peers,null, snippetComputationTime);// result without snippet
returnnewResultEntry(page,this.query.getSegment(),this.peers,null);// result without snippet
@ -58,21 +58,16 @@ public class ResultEntry implements Comparable<ResultEntry>, Comparator<ResultEn
privatefinalTextSnippettextSnippet;
privatefinalSegmentindexSegment;
// statistic objects
publiclongsnippetComputationTime;
publicResultEntry(finalURIMetadataNodeurlentry,
finalSegmentindexSegment,
SeedDBpeers,
finalTextSnippettextSnippet,
finallongsnippetComputationTime){
finalTextSnippettextSnippet){
this.urlentry=urlentry;
this.urlentry.setField(CollectionSchema.text_t.getSolrFieldName(),"");// clear the text field which eats up most of the space; it was used for snippet computation which is in a separate field here