From 3e22d05290f6cfea618a5af2105a73a23dee5105 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Wed, 11 Sep 2013 12:52:18 +0200 Subject: [PATCH 1/3] added option for daterange properties in GSA interface to use an left- or right-open date range; i.e. using daterange=..2013-09-09 or daterange=2013-09-02.. additional to daterange=2013-09-02..2013-09-09 --- htroot/gsa/searchresult.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htroot/gsa/searchresult.java b/htroot/gsa/searchresult.java index e1a150cc8..6ccf143ee 100644 --- a/htroot/gsa/searchresult.java +++ b/htroot/gsa/searchresult.java @@ -141,10 +141,12 @@ public class searchresult { String origfq = post.get(CommonParams.FQ); String datefq = ""; for (String dr: daterange) { - String from_to[] = dr.split("\\.\\."); + String from_to[] = dr.endsWith("..") ? new String[]{dr.substring(0, dr.length() - 2), ""} : dr.startsWith("..") ? new String[]{"", dr.substring(2)} : dr.split("\\.\\."); if (from_to.length != 2) continue; - Date from = HeaderFramework.parseGSAFS(from_to[0]); if (from == null) continue; - Date to = HeaderFramework.parseGSAFS(from_to[1]); if (to == null) continue; + Date from = HeaderFramework.parseGSAFS(from_to[0]); + if (from == null) from = new Date(0); + Date to = HeaderFramework.parseGSAFS(from_to[1]); + if (to == null) to = new Date(); to.setTime(to.getTime() + 24L * 60L * 60L * 1000L); // we add a day because the day is inclusive String z = CollectionSchema.last_modified.getSolrFieldName() + ":[" + ISO8601Formatter.FORMATTER.format(from) + " TO " + ISO8601Formatter.FORMATTER.format(to) + "]"; datefq = datefq.length() == 0 ? z : " OR " + z; From 1a8c64117f8182aaac735727564eea89ce17fd97 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Wed, 11 Sep 2013 13:03:58 +0200 Subject: [PATCH 2/3] decreased the responseHeaderDB database which is now flushed more frequently. This will preserve more documents in the cache in case of a crash. --- source/net/yacy/crawler/data/Cache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/net/yacy/crawler/data/Cache.java b/source/net/yacy/crawler/data/Cache.java index 05bc2b2fc..ec08d3c68 100644 --- a/source/net/yacy/crawler/data/Cache.java +++ b/source/net/yacy/crawler/data/Cache.java @@ -83,7 +83,7 @@ public final class Cache { // open the response header database final File dbfile = new File(cachePath, RESPONSE_HEADER_DB_NAME); try { - responseHeaderDB = new MapHeap(dbfile, Word.commonHashLength, Base64Order.enhancedCoder, 1024 * 1024, 100, ' '); + responseHeaderDB = new MapHeap(dbfile, Word.commonHashLength, Base64Order.enhancedCoder, 2048, 100, ' '); } catch (final IOException e) { ConcurrentLog.logException(e); } From 603368fc3e3645734232051a52fd15f1469e2615 Mon Sep 17 00:00:00 2001 From: reger Date: Sat, 14 Sep 2013 18:29:44 +0200 Subject: [PATCH 3/3] remove redundant declaration of USER_AGENT --- source/net/yacy/cora/protocol/RequestHeader.java | 1 - 1 file changed, 1 deletion(-) diff --git a/source/net/yacy/cora/protocol/RequestHeader.java b/source/net/yacy/cora/protocol/RequestHeader.java index faee711cc..406269cfb 100644 --- a/source/net/yacy/cora/protocol/RequestHeader.java +++ b/source/net/yacy/cora/protocol/RequestHeader.java @@ -34,7 +34,6 @@ public class RequestHeader extends HeaderFramework { public static final String CONNECTION = "Connection"; public static final String PROXY_CONNECTION = "Proxy-Connection"; public static final String KEEP_ALIVE = "Keep-Alive"; - public static final String USER_AGENT = "User-Agent"; public static final String AUTHORIZATION = "Authorization"; public static final String WWW_AUTHENTICATE = "WWW-Authenticate";