From: Adam Dickmeiss Date: Thu, 8 Mar 2012 13:30:51 +0000 (+0100) Subject: termlist: generate empty for non-matched entries X-Git-Tag: v1.6.12~3 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=0287b115b413448cc038c36b21d0b73a77b40976;p=pazpar2-moved-to-github.git termlist: generate empty for non-matched entries This, partly, reverts 8b22d0dda50f29c25ec63e749b8c32738530498c . --- diff --git a/src/session.c b/src/session.c index 6dce5d9..16b7146 100644 --- a/src/session.c +++ b/src/session.c @@ -1069,7 +1069,8 @@ void perform_termlist(struct http_channel *c, struct session *se, for (j = 0; j < num_names; j++) { const char *tname; - + int must_generate_empty = 1; /* bug 5350 */ + for (i = 0; i < se->num_termlists; i++) { tname = se->termlists[i].name; @@ -1081,6 +1082,7 @@ void perform_termlist(struct http_channel *c, struct session *se, wrbuf_puts(c->wrbuf, "wrbuf, tname); wrbuf_puts(c->wrbuf, "\">\n"); + must_generate_empty = 0; p = termlist_highscore(se->termlists[i].termlist, &len); if (p) @@ -1115,6 +1117,13 @@ void perform_termlist(struct http_channel *c, struct session *se, targets_termlist_nb(c->wrbuf, se, num, c->nmem); wrbuf_puts(c->wrbuf, "\n"); + must_generate_empty = 0; + } + if (must_generate_empty) + { + wrbuf_puts(c->wrbuf, "wrbuf, names[j]); + wrbuf_puts(c->wrbuf, "\"/>\n"); } } session_leave(se); diff --git a/test/test_facets_11.res b/test/test_facets_11.res index 6045d02..009806d 100644 --- a/test/test_facets_11.res +++ b/test/test_facets_11.res @@ -45,4 +45,5 @@ date820 date910 + \ No newline at end of file diff --git a/test/test_facets_17.res b/test/test_facets_17.res index 7765713..085dbd7 100644 --- a/test/test_facets_17.res +++ b/test/test_facets_17.res @@ -45,4 +45,5 @@ date820 date910 + \ No newline at end of file diff --git a/test/test_facets_18.res b/test/test_facets_18.res index 7765713..085dbd7 100644 --- a/test/test_facets_18.res +++ b/test/test_facets_18.res @@ -45,4 +45,5 @@ date820 date910 + \ No newline at end of file diff --git a/test/test_facets_24.res b/test/test_facets_24.res index 512b81f..53eb749 100644 --- a/test/test_facets_24.res +++ b/test/test_facets_24.res @@ -40,4 +40,5 @@ date820 date910 + \ No newline at end of file diff --git a/test/test_facets_6.res b/test/test_facets_6.res index f78c7dc..bfef71d 100644 --- a/test/test_facets_6.res +++ b/test/test_facets_6.res @@ -30,4 +30,5 @@ 19731 19801 + \ No newline at end of file