Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

added support for filetype search (just use filetype:<type> in the search query)

orbiter28d2d2857377
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index 55e585472..46f53e0d3 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -206,6 +206,14 @@ public class yacysearch {
lr = querystring.substring(lrp + 9, lrp + 11).toLowerCase();
query[0].remove("language:" + lr);
}
+ int filetype = querystring.indexOf("filetype:");
+ if (filetype >= 0) {
+ int ftb = querystring.indexOf(' ', filetype);
+ if (ftb == -1) ftb = querystring.length();
+ String ft = querystring.substring(filetype + 9, ftb);
+ query[0].remove("filetype:" + ft.toLowerCase());
+ urlmask = ".*." + ft;
+ }
// read the language from the language-restrict option 'lr'
// if no one is given, use the user agent or the system language as default