If given, that overrides the value of 'truncmax'.
+For searches, allow truncmax value to be controlled with attribute 13.
+If given, that overrides the value of 'truncmax'.
+
For truncations being limited (abort at truncmax terms), zebrasrv returns
SearchResponse with resultSetStatus=subset.
For truncations being limited (abort at truncmax terms), zebrasrv returns
SearchResponse with resultSetStatus=subset.
<chapter id="querymodel">
<chapter id="querymodel">
- <!-- $Id: querymodel.xml,v 1.27 2006-11-30 10:33:19 adam Exp $ -->
+ <!-- $Id: querymodel.xml,v 1.28 2007-01-17 12:59:38 adam Exp $ -->
<title>Query Model</title>
<section id="querymodel-overview">
<title>Query Model</title>
<section id="querymodel-overview">
<entry>2.0.8</entry>
</row>
</tbody>
<entry>2.0.8</entry>
</row>
</tbody>
+ <row>
+ <entry>Maximum number of truncated terms (truncmax)</entry>
+ <entry>13</entry>
+ <entry>search</entry>
+ <entry>2.0.10</entry>
+ </row>
-/* $Id: rpnsearch.c,v 1.7 2007-01-16 15:31:23 adam Exp $
+/* $Id: rpnsearch.c,v 1.8 2007-01-17 12:59:38 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
Copyright (C) 1995-2007
Index Data ApS
struct grep_info *grep_info,
int reg_type)
{
struct grep_info *grep_info,
int reg_type)
{
- AttrType termset;
- int termset_value_numeric;
- const char *termset_value_string;
-
#ifdef TERM_COUNT
grep_info->term_no = 0;
#endif
#ifdef TERM_COUNT
grep_info->term_no = 0;
#endif
grep_info->zh = zh;
grep_info->reg_type = reg_type;
grep_info->termset = 0;
grep_info->zh = zh;
grep_info->reg_type = reg_type;
grep_info->termset = 0;
- if (!zapt)
- return ZEBRA_OK;
- attr_init_APT(&termset, zapt, 8);
- termset_value_numeric =
- attr_find_ex(&termset, NULL, &termset_value_string);
- if (termset_value_numeric != -1)
+ if (zapt)
+ {
+ AttrType truncmax;
+ int truncmax_value;
+
+ attr_init_APT(&truncmax, zapt, 13);
+ truncmax_value = attr_find(&truncmax, NULL);
+ if (truncmax_value != -1)
+ grep_info->trunc_max = truncmax_value;
+ }
+ if (zapt)
+ AttrType termset;
+ int termset_value_numeric;
+ const char *termset_value_string;
+
+ attr_init_APT(&termset, zapt, 8);
+ termset_value_numeric =
+ attr_find_ex(&termset, NULL, &termset_value_string);
+ if (termset_value_numeric != -1)
+ {
- zebra_setError(zh, YAZ_BIB1_UNSUPP_SEARCH, "termset");
- return ZEBRA_FAIL;
+ zebra_setError(zh, YAZ_BIB1_UNSUPP_SEARCH, "termset");
+ return ZEBRA_FAIL;
- char resname[32];
- const char *termset_name = 0;
- if (termset_value_numeric != -2)
- {
-
- sprintf(resname, "%d", termset_value_numeric);
- termset_name = resname;
- }
- else
+ char resname[32];
+ const char *termset_name = 0;
+ if (termset_value_numeric != -2)
+ {
+
+ sprintf(resname, "%d", termset_value_numeric);
+ termset_name = resname;
+ }
+ else
termset_name = termset_value_string;
termset_name = termset_value_string;
- yaz_log(log_level_rpn, "creating termset set %s", termset_name);
- grep_info->termset = resultSetAdd(zh, termset_name, 1);
- if (!grep_info->termset)
- {
- zebra_setError(zh, YAZ_BIB1_ILLEGAL_RESULT_SET_NAME, termset_name);
- return ZEBRA_FAIL;
- }
+ yaz_log(log_level_rpn, "creating termset set %s", termset_name);
+ grep_info->termset = resultSetAdd(zh, termset_name, 1);
+ if (!grep_info->termset)
+ {
+ zebra_setError(zh, YAZ_BIB1_ILLEGAL_RESULT_SET_NAME, termset_name);
+ return ZEBRA_FAIL;
+ }