automatically add a wild card if only a search on a single domain is

done. This makes it possible to search all documents on a single domain
even if no search word is given. This is in particular interesting when
searching for all images on a single domain.
This commit is contained in:
Michael Peter Christen 2014-09-15 13:38:53 +02:00
parent abde89438b
commit 9b92685771

View File

@ -362,6 +362,7 @@ public class yacysearch {
final RankingProfile ranking = sb.getRanking();
final QueryModifier modifier = new QueryModifier();
querystring = modifier.parse(querystring);
if (modifier.sitehost != null && modifier.sitehost.length() > 0 && querystring.length() == 0) querystring = "*"; // allow to search for all documents on a host
// read collection
modifier.collection = post.get("collection", modifier.collection); // post arguments may overrule parsed collection values
@ -372,7 +373,7 @@ public class yacysearch {
if (querystring.length() == 1) {
querystring = Segment.catchallString;
} else {
querystring = querystring.replace('*', ' ').replaceAll(" ", " ");
querystring = querystring.replaceAll("* ", Segment.catchallString + " ").replace(" *", " " + Segment.catchallString);
}
}
if ( querystring.indexOf("/near", 0) >= 0 ) {