Subj : efficient searchs
To : DOVE-Net.Sync_JavaScript
From : Ragnarok
Date : Fri Nov 25 2005 05:29 pm
hi !
i begin to play with js
i try to search in message base, but search one to one is poor performance
do you have another code that search in the base with more speed?
maybe some method more optimized?
a global menssage base index?
a gift from google? :)
for (grp in msg_area.grp_list) {
for (sub in msg_area.grp_list[grp].sub_list) {
msg = new MsgBase(msg_area.grp_list[grp].sub_list[sub].code);
if (msg.open()) {
for (i=0;i< msg.total_msgs;i++) {
mensaje = msg.get_msg_header(true,i);
if (mensaje != null) {
if (mensaje.subject.indexOf("hola") >= 0) {
writeln(mensaje.from);
writeln("
");
writeln(mensaje.subject);
writeln("
");
}
}
else
writeln ("error getting message");
}
msg.close();
}
else {
writeln ("Error al abrir la base de mensajes: " +
msg_base.grp_list[grp].
}
}
}
---
þ Synchronet þ Dock Sud BBS TLD 24 HS - www.docksud.com.ar
.