enhanced termlist

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7914 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 13 years ago
parent b5252ef91f
commit 6db8921a0f

@ -59,10 +59,17 @@ public class termlist_p {
final Row referenceRow = segment.termIndex().referenceRow(); final Row referenceRow = segment.termIndex().referenceRow();
final int rowsize = referenceRow.objectsize; final int rowsize = referenceRow.objectsize;
final ArrayList<byte[]> deleteterms = new ArrayList<byte[]>(); final ArrayList<byte[]> deleteterms = new ArrayList<byte[]>();
long over1000 = 0, over10000 = 0, over100000 = 0, over1000000 = 0, over10000000 = 0, over100000000 = 0;
while (i.hasNext()) { while (i.hasNext()) {
e = i.next(); e = i.next();
termnumber++; termnumber++;
count = e.getScore(); count = e.getScore();
if (count > 1000) over1000++;
if (count > 10000) over10000++;
if (count > 100000) over100000++;
if (count > 1000000) over1000000++;
if (count > 10000000) over10000000++;
if (count > 100000000) over100000000++;
if (count > maxcount) { if (count > maxcount) {
maxcount = count; maxcount = count;
maxterm = e.getObject(); maxterm = e.getObject();
@ -92,8 +99,15 @@ public class termlist_p {
prop.put("terms", c); prop.put("terms", c);
prop.put("maxterm", maxterm == null ? "" : ASCII.String(maxterm)); prop.put("maxterm", maxterm == null ? "" : ASCII.String(maxterm));
prop.put("maxcount", maxcount); prop.put("maxcount", maxcount);
prop.put("maxcountmemory", 20 + maxcount * rowsize);
prop.put("termnumber", termnumber); prop.put("termnumber", termnumber);
prop.put("totalmemory", totalmemory); prop.put("totalmemory", totalmemory);
prop.put("over1000", over1000);
prop.put("over10000", over10000);
prop.put("over100000", over100000);
prop.put("over1000000", over1000000);
prop.put("over10000000", over10000000);
prop.put("over100000000", over100000000);
log.logWarning("finished termlist_p -> terms: " + c); log.logWarning("finished termlist_p -> terms: " + c);
log.logWarning("maxterm: "+ (maxterm == null ? "" : ASCII.String(maxterm))); log.logWarning("maxterm: "+ (maxterm == null ? "" : ASCII.String(maxterm)));

@ -1,12 +1,17 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<terms allcount="#[termnumber]#" selectcount="#[terms]#" selectmemory="#[totalmemory]#"> <terms
<maxterm hash="#[maxterm]#"> allcount="#[termnumber]#"
<count>#[maxcount]#</count> selectcount="#[terms]#"
</maxterm> selectmemory="#[totalmemory]#"
over1000="#[over1000]#"
over10000="#[over10000]#"
over100000="#[over100000]#"
over1000000="#[over1000000]#"
over10000000="#[over10000000]#"
over100000000="#[over100000000]#"
>
<maxterm hash="#[maxterm]#" count="#[maxcount]#" memory="#[maxcountmemory]#"/>
#{terms}# #{terms}#
<term hash="#[termhash]#" id="#[termhash]#"> <term hash="#[termhash]#" id="#[termhash]#" count="#[count]#" memory="#[memory]#"/>
<count>#[count]#</count>
<memory>#[memory]#</memory>
</term>
#{/terms}# #{/terms}#
</terms> </terms>
Loading…
Cancel
Save