must_quote = 1;
if (must_quote)
wrbuf_puts(w, "\"");
+ if (trunc == 2 || trunc == 3)
+ wrbuf_puts(w, "*");
for (i = 0 ; i < lterm; i++)
{
if (sterm[i] == '\\' && i < lterm - 1)
else
wrbuf_putc(w, sterm[i]);
}
- if (trunc == 1)
+ if (trunc == 1 || trunc == 3)
wrbuf_puts(w, "*");
if (must_quote)
wrbuf_puts(w, "\"");
ret = rpn2solr_attr(ct, apt->attributes, w);
if (ret)
return ret;
- if (trunc == 0 || trunc == 1 || trunc == 100 || trunc == 104)
+ if ((trunc >= 0 && trunc <= 3) || trunc == 100 || trunc == 104)
;
else
{
/* Truncation */
YAZ_CHECK(compare(ct, "@attr 5=1 water", "water*"));
- YAZ_CHECK(compare(ct, "@attr 5=2 water", 0));
- YAZ_CHECK(compare(ct, "@attr 5=3 water", 0));
+ YAZ_CHECK(compare(ct, "@attr 5=2 water", "*water"));
+ YAZ_CHECK(compare(ct, "@attr 5=3 water", "*water*"));
YAZ_CHECK(compare(ct, "@attr 5=100 water", "water"));
YAZ_CHECK(compare(ct, "@attr 5=101 water", 0));
YAZ_CHECK(compare(ct, "@attr 5=104 w#ter", "w?ter"));