added support for filetype search

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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5418 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 8c3205b62e
commit 28d2d28573

@ -206,6 +206,14 @@ public class yacysearch {
lr = querystring.substring(lrp + 9, lrp + 11).toLowerCase(); lr = querystring.substring(lrp + 9, lrp + 11).toLowerCase();
query[0].remove("language:" + lr); 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' // read the language from the language-restrict option 'lr'
// if no one is given, use the user agent or the system language as default // if no one is given, use the user agent or the system language as default

Loading…
Cancel
Save