char **names;
int num_names = 0;
- if (name)
- nmem_strsplit(nmem_tmp, ",", name, &names, &num_names);
+ if (!name)
+ name = "*";
+
+ nmem_strsplit(nmem_tmp, ",", name, &names, &num_names);
session_enter(se);
{
const char *tname;
- wrbuf_puts(c->wrbuf, "<list name=\"");
- wrbuf_xmlputs(c->wrbuf, names[j]);
- wrbuf_puts(c->wrbuf, "\">\n");
-
for (i = 0; i < se->num_termlists; i++)
{
tname = se->termlists[i].name;
- if (num_names > 0 && !strcmp(names[j], tname))
+ if (!strcmp(names[j], tname) || !strcmp(names[j], "*"))
{
struct termlist_score **p = 0;
int len;
+
+ wrbuf_puts(c->wrbuf, "<list name=\"");
+ wrbuf_xmlputs(c->wrbuf, tname);
+ wrbuf_puts(c->wrbuf, "\">\n");
+
p = termlist_highscore(se->termlists[i].termlist, &len);
if (p)
{
wrbuf_puts(c->wrbuf, "</term>\n");
}
}
+ wrbuf_puts(c->wrbuf, "</list>\n");
}
}
tname = "xtargets";
- if (num_names > 0 && !strcmp(names[j], tname))
+ if (!strcmp(names[j], tname) || !strcmp(names[j], "*"))
{
+ wrbuf_puts(c->wrbuf, "<list name=\"");
+ wrbuf_xmlputs(c->wrbuf, tname);
+ wrbuf_puts(c->wrbuf, "\">\n");
+
targets_termlist_nb(c->wrbuf, se, num, c->nmem);
+ wrbuf_puts(c->wrbuf, "</list>\n");
}
- wrbuf_puts(c->wrbuf, "</list>\n");
}
session_leave(se);
nmem_destroy(nmem_tmp);
http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Cauthor%2Csubject%2Cdate%2Cmedium
http://localhost:9763/search.pz2?session=1&command=search&query=8+and+computer
http://localhost:9763/search.pz2?session=1&command=show&block=1
-http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Cauthor%2Csubject%2Cdate%2Cmedium
+http://localhost:9763/search.pz2?session=1&command=termlist
http://localhost:9763/search.pz2?session=1&command=search&query=6+and+computer
http://localhost:9763/search.pz2?session=1&command=show
http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Cauthor%2Csubject%2Cdate%2Cmedium