@ -469,35 +469,41 @@ public class yacysearch {
sb . localSearches . add ( theQuery ) ;
// check suggestions
DidYouMean didYouMean = new DidYouMean ( sb ) ;
Iterator < String > meanIt = didYouMean . getSuggestion ( querystring ) . iterator ( ) ;
int meanCount = 0 ;
String suggestion ;
prop . put ( "didYouMean" , 0 ) ;
while ( meanIt . hasNext ( ) ) {
suggestion = meanIt . next ( ) ;
prop . put ( "didYouMean_suggestions_" + meanCount + "_word" , suggestion ) ;
prop . put ( "didYouMean_suggestions_" + meanCount + "_url" ,
"/yacysearch.html" + "?display=" + display +
"&search=" + suggestion +
"&maximumRecords=" + theQuery . displayResults ( ) +
"&startRecord=" + ( 0 * theQuery . displayResults ( ) ) +
"&resource=" + ( ( theQuery . isLocal ( ) ) ? "local" : "global" ) +
"&verify=" + ( ( theQuery . onlineSnippetFetch ) ? "true" : "false" ) +
"&nav=" + theQuery . navigators +
"&urlmaskfilter=" + originalUrlMask +
"&prefermaskfilter=" + theQuery . prefer +
"&cat=href&constraint=" + ( ( theQuery . constraint = = null ) ? "" : theQuery . constraint . exportB64 ( ) ) +
"&contentdom=" + theQuery . contentdom ( ) +
"&former=" + theQuery . queryString ( true )
) ;
prop . put ( "didYouMean_suggestions_" + meanCount + "_sep" , "|" ) ;
meanCount + + ;
int meanMax = 0 ;
if ( post ! = null & & post . containsKey ( "meanCount" ) ) {
meanMax = Integer . parseInt ( post . get ( "meanCount" ) ) ;
}
if ( meanMax > 0 ) {
DidYouMean didYouMean = new DidYouMean ( sb ) ;
Iterator < String > meanIt = didYouMean . getSuggestion ( querystring ) . iterator ( ) ;
int meanCount = 0 ;
String suggestion ;
while ( meanCount < meanMax & & meanIt . hasNext ( ) ) {
suggestion = meanIt . next ( ) ;
prop . put ( "didYouMean_suggestions_" + meanCount + "_word" , suggestion ) ;
prop . put ( "didYouMean_suggestions_" + meanCount + "_url" ,
"/yacysearch.html" + "?display=" + display +
"&search=" + suggestion +
"&maximumRecords=" + theQuery . displayResults ( ) +
"&startRecord=" + ( 0 * theQuery . displayResults ( ) ) +
"&resource=" + ( ( theQuery . isLocal ( ) ) ? "local" : "global" ) +
"&verify=" + ( ( theQuery . onlineSnippetFetch ) ? "true" : "false" ) +
"&nav=" + theQuery . navigators +
"&urlmaskfilter=" + originalUrlMask +
"&prefermaskfilter=" + theQuery . prefer +
"&cat=href&constraint=" + ( ( theQuery . constraint = = null ) ? "" : theQuery . constraint . exportB64 ( ) ) +
"&contentdom=" + theQuery . contentdom ( ) +
"&former=" + theQuery . queryString ( true )
) ;
prop . put ( "didYouMean_suggestions_" + meanCount + "_sep" , "|" ) ;
meanCount + + ;
}
prop . put ( "didYouMean_suggestions_" + ( meanCount - 1 ) + "_sep" , "" ) ;
prop . put ( "didYouMean" , 1 ) ;
prop . put ( "didYouMean_suggestions" , meanCount ) ;
} else {
prop . put ( "didYouMean" , 0 ) ;
}
prop . put ( "didYouMean_suggestions_" + ( meanCount - 1 ) + "_sep" , "" ) ;
if ( meanCount > 0 )
prop . put ( "didYouMean" , 1 ) ;
prop . put ( "didYouMean_suggestions" , meanCount ) ;
// update the search tracker
try {