-/* $Id: retrieve.c,v 1.81 2007-12-05 09:29:52 adam Exp $
+/* $Id: retrieve.c,v 1.82 2007-12-05 09:55:57 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
struct index_spec {
const char *index_name;
const char *index_type;
+ const char *extra;
struct index_spec *next;
};
struct index_spec *spec = nmem_malloc(nmem, sizeof(*spec));
spec->index_type = 0;
spec->next = 0;
+ spec->extra = 0;
if (!first)
first = spec;
cp++;
cp0 = cp;
- while (*cp != '\0' && *cp != ',')
+ while (*cp != '\0' && *cp != ',' && *cp != ':')
cp++;
spec->index_type = nmem_strdupn(nmem, cp0, cp - cp0);
}
+ if (*cp == ':') /* extra arguments */
+ {
+ cp++;
+ cp0 = cp;
+
+ while (*cp != '\0' && *cp != ',' && *cp != ':')
+ cp++;
+ spec->extra = nmem_strdupn(nmem, cp0, cp - cp0);
+ }
if (*cp != ',')
break;
}
zint *pos_array;
int i;
int num_recs = 10; /* number of records to analyze */
- int no_collect_terms = 20; /* number of term candidates */
ZebraMetaRecord *poset;
ZEBRA_RES ret = ZEBRA_OK;
int *ord_array;
{
int j;
NMEM nmem = nmem_create();
- struct term_collect *col = term_collect_create(map_array[i],
- no_collect_terms,
- nmem);
+ struct term_collect *col;
+ int no_collect_terms = 20;
+
+ if (spec->extra)
+ no_collect_terms = atoi(spec->extra);
+ if (no_collect_terms < 1)
+ no_collect_terms = 1;
+ col = term_collect_create(map_array[i], no_collect_terms, nmem);
term_collect_freq(zh, col, no_collect_terms, ord_array[i],
resultSetRef(zh, setname));
-/* $Id: safari1.c,v 1.22 2007-12-05 09:29:53 adam Exp $
+/* $Id: safari1.c,v 1.23 2007-12-05 09:55:10 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
ids[2] = 24340;
YAZ_CHECK(tl_meta_query(zh, "@attr 4=3 @attr 1=any mand", 3, ids));
-#if 1
YAZ_CHECK_EQ(tl_fetch_compare(zh, 1, "R", yaz_oid_recsyn_sutrs,
myrec[0]), ZEBRA_OK);
YAZ_CHECK_EQ(tl_fetch_compare(zh, 2, "R", yaz_oid_recsyn_sutrs,
myrec[2]), ZEBRA_OK);
YAZ_CHECK_EQ(tl_fetch_compare(zh, 3, "R", yaz_oid_recsyn_sutrs,
myrec[4]), ZEBRA_OK);
-#endif
-#if 1
YAZ_CHECK_EQ(tl_fetch_compare(zh, 1, "zebra::facet::any:0",
yaz_oid_recsyn_xml,
"<facets>\n"
" <term coccur=\"1\" occur=\"1\">old</term>\n"
" </facet>\n"
"</facets>\n"), ZEBRA_OK);
-#endif
+ YAZ_CHECK_EQ(tl_fetch_compare(zh, 1, "zebra::facet::any:0:2",
+ yaz_oid_recsyn_xml,
+ "<facets>\n"
+ " <facet type=\"0\" index=\"any\">\n"
+ " <term coccur=\"4\" occur=\"3\">mand</term>\n"
+ " <term coccur=\"4\" occur=\"3\">the</term>\n"
+ " </facet>\n"
+ "</facets>\n"), ZEBRA_OK);
+
/* limit to 125061 */
limits[0] = 125061;
limits[1] = 0;