From 9b24dae2b712b47241622be997c217bd46f3e784 Mon Sep 17 00:00:00 2001 From: reger Date: Sat, 25 Jan 2014 22:59:23 +0100 Subject: [PATCH] add language navigation filter clause to rwi results --- source/net/yacy/search/index/Segment.java | 1 - source/net/yacy/search/query/SearchEvent.java | 28 ++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/source/net/yacy/search/index/Segment.java b/source/net/yacy/search/index/Segment.java index 45f639a07..e52d63b2a 100644 --- a/source/net/yacy/search/index/Segment.java +++ b/source/net/yacy/search/index/Segment.java @@ -103,7 +103,6 @@ public class Segment { public static final int lowcachedivisor = 900; public static final long targetFileSize = 64 * 1024 * 1024; // 256 MB public static final int writeBufferSize = 4 * 1024 * 1024; - public static final String UrlDbName = "text.urlmd"; public static final String termIndexName = "text.index"; public static final String citationIndexName = "citation.index"; diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.java index 846d3d055..4d104b480 100644 --- a/source/net/yacy/search/query/SearchEvent.java +++ b/source/net/yacy/search/query/SearchEvent.java @@ -1077,7 +1077,15 @@ public final class SearchEvent { if (log.isFine()) log.fine("dropped RWI: file name domain does not match"); continue; } - + + // check modifier constraint (language) + // TODO: : page.language() never null but defaults to "en" (may cause false drop of result) + if (this.query.modifier.language != null && !this.query.modifier.language.equals(ASCII.String(page.language()))) { + if (log.isFine()) log.fine("dropped RWI: language constraint = " + this.query.modifier.language); + if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet(); + continue; + } + // Check for blacklist if (Switchboard.urlBlacklist.isListed(BlacklistType.SEARCH, page.url())) { if (log.isFine()) log.fine("dropped RWI: url is blacklisted in url blacklist"); @@ -1085,15 +1093,15 @@ public final class SearchEvent { continue; } - // content control - if (Switchboard.getSwitchboard().getConfigBool("contentcontrol.enabled", false)) { - FilterEngine f = ContentControlFilterUpdateThread.getNetworkFilter(); - if (f != null && !f.isListed(page.url(), null)) { - if (log.isFine()) log.fine("dropped RWI: url is blacklisted in contentcontrol"); - if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet(); - continue; - } - } + // content control + if (Switchboard.getSwitchboard().getConfigBool("contentcontrol.enabled", false)) { + FilterEngine f = ContentControlFilterUpdateThread.getNetworkFilter(); + if (f != null && !f.isListed(page.url(), null)) { + if (log.isFine()) log.fine("dropped RWI: url is blacklisted in contentcontrol"); + if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet(); + continue; + } + } final String pageurl = page.url().toNormalform(true); final String pageauthor = page.dc_creator();