Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
adjust rwi index result word position handling used for rwi ranking - correct WordReferenceVars.toRowEntry posintext parameter to set expected min posintext (the difference is on multi-word queries, while positions are ordered by search word order). - modified posofphrase/posinphrase join operation - to set min posofphrase - and keep posinphrase if not same posofphrase (was set to 0, no differentiation during ranking) + fix compiler msg (missing type declaration)
reger681a61dafb0b
diff --git a/source/net/yacy/kelondro/data/word/WordReferenceRow.java b/source/net/yacy/kelondro/data/word/WordReferenceRow.javaindex 025912de6..e90771e7c 100644--- a/source/net/yacy/kelondro/data/word/WordReferenceRow.java+++ b/source/net/yacy/kelondro/data/word/WordReferenceRow.java@@ -268,7 +268,7 @@ public final class WordReferenceRow extends AbstractReference implements WordRef@Overridepublic Collection<Integer> positions() {int pos = (int) this.entry.getColLong(col_posintext);- ArrayList arr = new ArrayList<Integer>(1);+ ArrayList<Integer> arr = new ArrayList<Integer>(1);arr.add(pos);return arr;}diff --git a/source/net/yacy/kelondro/data/word/WordReferenceVars.java b/source/net/yacy/kelondro/data/word/WordReferenceVars.javaindex 5160bfb1f..364576bce 100644--- a/source/net/yacy/kelondro/data/word/WordReferenceVars.java+++ b/source/net/yacy/kelondro/data/word/WordReferenceVars.java@@ -253,7 +253,7 @@ public class WordReferenceVars extends AbstractReference implements WordReferencthis.hitcount, // how often appears this word in the textthis.wordsintext, // total number of wordsthis.phrasesintext, // total number of phrases- this.positions.isEmpty() ? 0 : this.positions.iterator().next(), // position of word in all words (+ this.positions.isEmpty() ? 0 : minposition(), // position of word in all words (WordReferenceRow stores first position in text, minpos also important for joined references)this.posinphrase, // position of word in its phrasethis.posofphrase, // number of the phrase where word appearsthis.lastModified, // last-modified time of the document where word appears@@ -383,8 +383,17 @@ public class WordReferenceVars extends AbstractReference implements WordReferencfinal WordReference oe = (WordReference) r;this.positions.addAll(oe.positions());- this.posinphrase = (this.posofphrase == oe.posofphrase()) ? Math.min(this.posinphrase, oe.posinphrase()) : 0;- this.posofphrase = Math.min(this.posofphrase, oe.posofphrase());++ // join phrase+ // this.posinphrase = (this.posofphrase == oe.posofphrase()) ? Math.min(this.posinphrase, oe.posinphrase()) : 0;+ // this.posofphrase = Math.min(this.posofphrase, oe.posofphrase());+ final int oePosofphrase = oe.posofphrase();+ if (this.posofphrase == oePosofphrase) {+ this.posinphrase = Math.min(this.posinphrase, oe.posinphrase());+ } else if (this.posofphrase > oePosofphrase) {+ this.posofphrase = oePosofphrase; // choose min posofphrase+ this.posinphrase = oe.posinphrase(); // with corresponding posinphrase+ }// combine term frequencythis.termFrequency = this.termFrequency + oe.termFrequency();