Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

enhanced termlist

orbiter6db8921a0f6b
diff --git a/htroot/api/termlist_p.java b/htroot/api/termlist_p.java
index 31b069d81..78f84fd55 100644
--- a/htroot/api/termlist_p.java
+++ b/htroot/api/termlist_p.java
@@ -59,10 +59,17 @@ public class termlist_p {
final Row referenceRow = segment.termIndex().referenceRow();
final int rowsize = referenceRow.objectsize;
final ArrayList<byte[]> deleteterms = new ArrayList<byte[]>();
+ long over1000 = 0, over10000 = 0, over100000 = 0, over1000000 = 0, over10000000 = 0, over100000000 = 0;
while (i.hasNext()) {
e = i.next();
termnumber++;
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) {
maxcount = count;
maxterm = e.getObject();
@@ -92,8 +99,15 @@ public class termlist_p {
prop.put("terms", c);
prop.put("maxterm", maxterm == null ? "" : ASCII.String(maxterm));
prop.put("maxcount", maxcount);
+ prop.put("maxcountmemory", 20 + maxcount * rowsize);
prop.put("termnumber", termnumber);
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("maxterm: "+ (maxterm == null ? "" : ASCII.String(maxterm)));
diff --git a/htroot/api/termlist_p.xml b/htroot/api/termlist_p.xml
index 57c202ed2..dafa22f3d 100644
--- a/htroot/api/termlist_p.xml
+++ b/htroot/api/termlist_p.xml
@@ -1,12 +1,17 @@
<?xml version="1.0"?>
-<terms allcount="#[termnumber]#" selectcount="#[terms]#" selectmemory="#[totalmemory]#">
-<maxterm hash="#[maxterm]#">
- <count>#[maxcount]#</count>
-</maxterm>
+<terms
+ allcount="#[termnumber]#"
+ selectcount="#[terms]#"
+ selectmemory="#[totalmemory]#"
+ over1000="#[over1000]#"
+ over10000="#[over10000]#"
+ over100000="#[over100000]#"
+ over1000000="#[over1000000]#"
+ over10000000="#[over10000000]#"
+ over100000000="#[over100000000]#"
+>
+ <maxterm hash="#[maxterm]#" count="#[maxcount]#" memory="#[maxcountmemory]#"/>
#{terms}#
- <term hash="#[termhash]#" id="#[termhash]#">
- <count>#[count]#</count>
- <memory>#[memory]#</memory>
- </term>
+ <term hash="#[termhash]#" id="#[termhash]#" count="#[count]#" memory="#[memory]#"/>
#{/terms}#
</terms>
\ No newline at end of file