From 0cf9ebc3b02b80ab4fab605aebf5fdd9a9c31db4 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 24 Nov 2011 17:37:04 +0000 Subject: [PATCH] speed enhancements when parsing RWI rows (makes search slightly faster) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@8096 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacysearch.java | 4 ++-- .../kelondro/data/word/WordReferenceRow.java | 17 ++++++++--------- .../net/yacy/search/ranking/ReferenceOrder.java | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 51898b970..b8b11ada0 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -299,11 +299,11 @@ public class yacysearch { } if (querystring.indexOf("/http") >= 0) { querystring = querystring.replace("/http", ""); - urlmask = "http://.*"; + urlmask = "https?://.*"; } if (querystring.indexOf("/https") >= 0) { querystring = querystring.replace("/https", ""); - urlmask = "https://.*"; + urlmask = "https?://.*"; } if (querystring.indexOf("/ftp") >= 0) { querystring = querystring.replace("/ftp", ""); diff --git a/source/net/yacy/kelondro/data/word/WordReferenceRow.java b/source/net/yacy/kelondro/data/word/WordReferenceRow.java index b9ebaff3a..b2a92fd76 100644 --- a/source/net/yacy/kelondro/data/word/WordReferenceRow.java +++ b/source/net/yacy/kelondro/data/word/WordReferenceRow.java @@ -81,7 +81,6 @@ public final class WordReferenceRow extends AbstractReference implements WordRef public static final Row.Entry poisonRowEntry = urlEntryRow.newEntry(); public static final WordReferenceRow poison = new WordReferenceRow(poisonRowEntry); - // static properties private static final int col_urlhash = 0; // h 12 the url hash b64-encoded private static final int col_lastModified = 1; // a 2 last-modified time of the document where word appears @@ -316,7 +315,7 @@ public final class WordReferenceRow extends AbstractReference implements WordRef } public int hitcount() { - return (int) this.entry.getColLong(col_hitcount); + return (0xff & this.entry.getColByte(col_hitcount)); } public Collection positions() { @@ -329,11 +328,11 @@ public final class WordReferenceRow extends AbstractReference implements WordRef } public int posinphrase() { - return (int) this.entry.getColLong(col_posinphrase); + return (0xff & this.entry.getColByte(col_posinphrase)); } public int posofphrase() { - return (int) this.entry.getColLong(col_posofphrase); + return (0xff & this.entry.getColByte(col_posofphrase)); } public int wordsintext() { @@ -353,23 +352,23 @@ public final class WordReferenceRow extends AbstractReference implements WordRef } public int wordsintitle() { - return (int) this.entry.getColLong(col_wordsInTitle); + return (0xff & this.entry.getColByte(col_wordsInTitle)); } public int llocal() { - return (int) this.entry.getColLong(col_llocal); + return (0xff & this.entry.getColByte(col_llocal)); } public int lother() { - return (int) this.entry.getColLong(col_lother); + return (0xff & this.entry.getColByte(col_lother)); } public int urllength() { - return (int) this.entry.getColLong(col_urlLength); + return (0xff & this.entry.getColByte(col_urlLength)); } public int urlcomps() { - return (int) this.entry.getColLong(col_urlComps); + return (0xff & this.entry.getColByte(col_urlComps)); } public Bitfield flags() { diff --git a/source/net/yacy/search/ranking/ReferenceOrder.java b/source/net/yacy/search/ranking/ReferenceOrder.java index 33de6df47..ceea48447 100644 --- a/source/net/yacy/search/ranking/ReferenceOrder.java +++ b/source/net/yacy/search/ranking/ReferenceOrder.java @@ -219,7 +219,7 @@ public class ReferenceOrder { + ((this.ranking.coeff_ybr > 12) ? ((256 - (BlockRank.ranking(t.urlhash()) << 4)) << this.ranking.coeff_ybr) : 0) + ((this.max.urlcomps() == this.min.urlcomps() ) ? 0 : (256 - (((t.urlcomps() - this.min.urlcomps() ) << 8) / (this.max.urlcomps() - this.min.urlcomps()) )) << this.ranking.coeff_urlcomps) + ((this.max.urllength() == this.min.urllength() ) ? 0 : (256 - (((t.urllength() - this.min.urllength() ) << 8) / (this.max.urllength() - this.min.urllength()) )) << this.ranking.coeff_urllength) - + ((maxmaxpos == minminpos) ? 0 : (256 - (((t.minposition() - minminpos) << 8) / (maxmaxpos - minminpos))) << this.ranking.coeff_posintext) + + ((maxmaxpos == minminpos) ? 0 : (256 - (((t.minposition() - minminpos) << 8) / (maxmaxpos - minminpos))) << this.ranking.coeff_posintext) + ((this.max.posofphrase() == this.min.posofphrase()) ? 0 : (256 - (((t.posofphrase() - this.min.posofphrase() ) << 8) / (this.max.posofphrase() - this.min.posofphrase()) )) << this.ranking.coeff_posofphrase) + ((this.max.posinphrase() == this.min.posinphrase()) ? 0 : (256 - (((t.posinphrase() - this.min.posinphrase() ) << 8) / (this.max.posinphrase() - this.min.posinphrase()) )) << this.ranking.coeff_posinphrase) + ((this.max.distance() == this.min.distance() ) ? 0 : (256 - (((t.distance() - this.min.distance() ) << 8) / (this.max.distance() - this.min.distance()) )) << this.ranking.coeff_worddistance)