Permalink
Browse files

Made "site:" query modifier case insensitive.

  • Loading branch information...
luccioman committed Dec 4, 2017
1 parent 867388e commit 8fbf25d1ed3b23d37edf72a7ca144bd1bc354289
Showing with 6 additions and 2 deletions.
  1. +6 −2 source/net/yacy/search/query/QueryModifier.java
@@ -226,8 +226,9 @@ private String filetypeParser(String querystring, final String filetypePrefix) {
}
/**
* Parses the query string for any eventual site modifier (site:), and fill the
* {@link #sitehost} and {@link #sitehash} attributes accordingly.
* Parses the query string for any eventual site modifier (site:), adjust it to
* lower case, and fill the {@link #sitehost} and {@link #sitehash} attributes
* accordingly.
*
* @param querystring
* the query string. Must not be null.
@@ -249,6 +250,9 @@ protected String parseSiteModifier(String querystring) {
while ( sitehost.endsWith(".") ) {
this.sitehost = this.sitehost.substring(0, this.sitehost.length() - 1);
}
/* Domain name in an URL is case insensitive : convert now modifier to lower case for further processing over normalized URLs */
this.sitehost = this.sitehost.toLowerCase(Locale.ROOT);
try {
this.sitehash = DigestURL.hosthash(this.sitehost, this.sitehost.startsWith("ftp.") ? 21 : 80);
} catch (MalformedURLException e) {

0 comments on commit 8fbf25d

Please sign in to comment.