search performance enhancement

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6795 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 4ec0092677
commit 67ec58d8e7

@ -173,8 +173,8 @@ public class ReferenceOrder {
+ ((flags.get(Condenser.flag_cat_hasaudio)) ? 255 << ranking.coeff_cathasaudio : 0)
+ ((flags.get(Condenser.flag_cat_hasvideo)) ? 255 << ranking.coeff_cathasvideo : 0)
+ ((flags.get(Condenser.flag_cat_hasapp)) ? 255 << ranking.coeff_cathasapp : 0)
+ ((patchUK(t.language).equals(this.language)) ? 255 << ranking.coeff_language : 0)
+ ((DigestURI.probablyRootURL(t.metadataHash().getBytes())) ? 15 << ranking.coeff_urllength : 0);
+ ((patchUK(t.language).equals(this.language)) ? 255 << ranking.coeff_language : 0)
+ ((DigestURI.probablyRootURL(t.metadataHash())) ? 15 << ranking.coeff_urllength : 0);
//if (searchWords != null) r += (yacyURL.probablyWordURL(t.urlHash(), searchWords) != null) ? 256 << ranking.coeff_appurl : 0;
return Long.MAX_VALUE - r; // returns a reversed number: the lower the number the better the ranking. This is used for simple sorting with a TreeMap

@ -893,8 +893,14 @@ public class DigestURI implements Serializable {
private static final char rootURLFlag0 = subdomPortPath("", 80, "");
private static final char rootURLFlag1 = subdomPortPath("www", 80, "");
public static final boolean probablyRootURL(String urlHash) {
char c = urlHash.charAt(5);
return c == rootURLFlag0 || c == rootURLFlag1;
}
public static final boolean probablyRootURL(final byte[] urlHash) {
return (urlHash[5] == rootURLFlag0) || (urlHash[5] == rootURLFlag1);
char c = (char) urlHash[5];
return c == rootURLFlag0 || c == rootURLFlag1;
}
private static final String hosthash5(final String protocol, final String host, final int port) {

@ -392,7 +392,7 @@ public class URIMetadataRow implements URIMetadata {
// avoid double computation of metadata elements
if (this.comp != null) return this.comp;
// parse elements from comp string;
final Iterator<String> cl = FileUtils.strings(this.entry.getCol("comp", null));
final Iterator<String> cl = FileUtils.strings(this.entry.getColBytes(col_comp, true));
this.comp = new Components(
(cl.hasNext()) ? cl.next() : "",
hash(),

Loading…
Cancel
Save