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
pull/1/head
orbiter 13 years ago
parent da55a359e9
commit 0cf9ebc3b0

@ -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", "");

@ -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<Integer> 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() {

@ -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)

Loading…
Cancel
Save