@ -480,6 +480,7 @@ public class yacysearch {
offset = 0 ;
offset = 0 ;
}
}
final SearchEvent theSearch = SearchEventCache . getEvent ( theQuery , sb . peers , sb . crawlResults , ( sb . isRobinsonMode ( ) ) ? sb . clusterhashes : null , false ) ;
final SearchEvent theSearch = SearchEventCache . getEvent ( theQuery , sb . peers , sb . crawlResults , ( sb . isRobinsonMode ( ) ) ? sb . clusterhashes : null , false ) ;
try { Thread . sleep ( 100 ) ; } catch ( InterruptedException e1 ) { } // wait a little time to get first results in the search
// generate result object
// generate result object
//serverLog.logFine("LOCAL_SEARCH", "SEARCH TIME AFTER ORDERING OF SEARCH RESULTS: " + (System.currentTimeMillis() - timestamp) + " ms");
//serverLog.logFine("LOCAL_SEARCH", "SEARCH TIME AFTER ORDERING OF SEARCH RESULTS: " + (System.currentTimeMillis() - timestamp) + " ms");
@ -490,11 +491,11 @@ public class yacysearch {
// log
// log
Log . logInfo ( "LOCAL_SEARCH" , "EXIT WORD SEARCH: " + theQuery . queryString + " - " +
Log . logInfo ( "LOCAL_SEARCH" , "EXIT WORD SEARCH: " + theQuery . queryString + " - " +
( theSearch . getRankingResult ( ) . getLocal ResourceSize ( ) + theSearch . getRankingResult ( ) . getRemoteResourceSize ( ) ) + " links found, " +
( theSearch . getRankingResult ( ) . getLocal IndexCount ( ) + theSearch . getRankingResult ( ) . getRemoteResourceSize ( ) ) + " links found, " +
( System . currentTimeMillis ( ) - timestamp ) + " ms" ) ;
( System . currentTimeMillis ( ) - timestamp ) + " ms" ) ;
// prepare search statistics
// prepare search statistics
theQuery . resultcount = theSearch . getRankingResult ( ) . getLocal ResourceSize ( ) + theSearch . getRankingResult ( ) . getRemoteResourceSize ( ) ;
theQuery . resultcount = theSearch . getRankingResult ( ) . getLocal IndexCount ( ) + theSearch . getRankingResult ( ) . getRemoteResourceSize ( ) ;
theQuery . searchtime = System . currentTimeMillis ( ) - timestamp ;
theQuery . searchtime = System . currentTimeMillis ( ) - timestamp ;
theQuery . urlretrievaltime = theSearch . result ( ) . getURLRetrievalTime ( ) ;
theQuery . urlretrievaltime = theSearch . result ( ) . getURLRetrievalTime ( ) ;
theQuery . snippetcomputationtime = theSearch . result ( ) . getSnippetComputationTime ( ) ;
theQuery . snippetcomputationtime = theSearch . result ( ) . getSnippetComputationTime ( ) ;
@ -570,13 +571,12 @@ public class yacysearch {
Log . logException ( e ) ;
Log . logException ( e ) ;
}
}
final int totalcount = theSearch . getRankingResult ( ) . getLocalResourceSize ( ) + theSearch . getRankingResult ( ) . getRemoteResourceSize ( ) ;
prop . put ( "num-results_offset" , offset ) ;
prop . put ( "num-results_offset" , offset ) ;
prop . put ( "num-results_itemscount" , Formatter . number ( 0 , true ) ) ;
prop . put ( "num-results_itemscount" , Formatter . number ( 0 , true ) ) ;
prop . put ( "num-results_itemsPerPage" , itemsPerPage ) ;
prop . put ( "num-results_itemsPerPage" , itemsPerPage ) ;
prop . put ( "num-results_totalcount" , Formatter . number ( t otalcount , true ) ) ;
prop . put ( "num-results_totalcount" , Formatter . number ( t heSearch. getRankingResult ( ) . getLocalIndexCount ( ) + theSearch . getRankingResult ( ) . getRemoteResourceSize ( ) , true ) ) ;
prop . put ( "num-results_globalresults" , ( globalsearch ) ? "1" : "0" ) ;
prop . put ( "num-results_globalresults" , ( globalsearch ) ? "1" : "0" ) ;
prop . put ( "num-results_globalresults_localResourceSize" , Formatter . number ( theSearch . getRankingResult ( ) . getLocal ResourceSize ( ) , true ) ) ;
prop . put ( "num-results_globalresults_localResourceSize" , Formatter . number ( theSearch . getRankingResult ( ) . getLocal IndexCount ( ) , true ) ) ;
prop . put ( "num-results_globalresults_remoteResourceSize" , Formatter . number ( theSearch . getRankingResult ( ) . getRemoteResourceSize ( ) , true ) ) ;
prop . put ( "num-results_globalresults_remoteResourceSize" , Formatter . number ( theSearch . getRankingResult ( ) . getRemoteResourceSize ( ) , true ) ) ;
prop . put ( "num-results_globalresults_remoteIndexCount" , Formatter . number ( theSearch . getRankingResult ( ) . getRemoteIndexCount ( ) , true ) ) ;
prop . put ( "num-results_globalresults_remoteIndexCount" , Formatter . number ( theSearch . getRankingResult ( ) . getRemoteIndexCount ( ) , true ) ) ;
prop . put ( "num-results_globalresults_remotePeerCount" , Formatter . number ( theSearch . getRankingResult ( ) . getRemotePeerCount ( ) , true ) ) ;
prop . put ( "num-results_globalresults_remotePeerCount" , Formatter . number ( theSearch . getRankingResult ( ) . getRemotePeerCount ( ) , true ) ) ;
@ -591,7 +591,7 @@ public class yacysearch {
resnav . append ( QueryParams . navurl ( "html" , thispage - 1 , display , theQuery , originalUrlMask , null , navigation ) ) ;
resnav . append ( QueryParams . navurl ( "html" , thispage - 1 , display , theQuery , originalUrlMask , null , navigation ) ) ;
resnav . append ( "\"><img src=\"env/grafics/navdl.gif\" width=\"16\" height=\"16\"></a> " ) ;
resnav . append ( "\"><img src=\"env/grafics/navdl.gif\" width=\"16\" height=\"16\"></a> " ) ;
}
}
final int numberofpages = Math . min ( 10 , Math . max ( thispage + 1 , totalcount / theQuery . displayResults ( ) ) ) ;
final int numberofpages = Math . min ( 10 , Math . max ( 1 + thispage , 1 + ( ( theSearch . getRankingResult ( ) . getLocalIndexCount ( ) < 11 ) ? theSearch . getRankingResult ( ) . getLocalResourceSize ( ) : theSearch . getRankingResult ( ) . getLocalIndexCount ( ) ) / theQuery . displayResults ( ) ) ) ;
for ( int i = 0 ; i < numberofpages ; i + + ) {
for ( int i = 0 ; i < numberofpages ; i + + ) {
if ( i = = thispage ) {
if ( i = = thispage ) {
resnav . append ( "<img src=\"env/grafics/navs" ) ;
resnav . append ( "<img src=\"env/grafics/navs" ) ;
@ -614,7 +614,7 @@ public class yacysearch {
}
}
String resnavs = resnav . toString ( ) ;
String resnavs = resnav . toString ( ) ;
prop . put ( "num-results_resnav" , resnavs ) ;
prop . put ( "num-results_resnav" , resnavs ) ;
prop . put ( "pageNavBottom" , ( t otalcount - offset > 6 ) ? 1 : 0 ) ; // if there are more results than may fit on the page we add a navigation at the bottom
prop . put ( "pageNavBottom" , ( t heSearch. getRankingResult ( ) . getLocalIndexCount ( ) - offset > 6 ) ? 1 : 0 ) ; // if there are more results than may fit on the page we add a navigation at the bottom
prop . put ( "pageNavBottom_resnav" , resnavs ) ;
prop . put ( "pageNavBottom_resnav" , resnavs ) ;
// generate the search result lines; the content will be produced by another servlet
// generate the search result lines; the content will be produced by another servlet