return mergekey_norm;
}
-static const char *str_tok_n(const char *s, const char *delim,
- const char **res, size_t *len)
-{
- *res = s;
- while (*s && !strchr(delim, *s))
- s++;
- *len = s - *res;
- if (*len == 0)
- return 0;
- if (*s && strchr(delim, *s))
- s++;
- return s;
-}
-
/** \brief see if metadata for pz:recordfilter exists
\param root xml root element of normalized record
\param sdb session database for client
xmlChar *type = xmlGetProp(n, (xmlChar *) "type");
if (type)
{
- const char *s1 = s;
size_t len;
- const char *value;
- while ((s1 = str_tok_n(s1, ",", &value, &len)) != 0)
+ const char *eq = strchr(s, '=');
+ if (eq)
+ len = eq - s;
+ else
+ len = strlen(s);
+ if (len == strlen((const char *)type) &&
+ !memcmp((const char *) type, s, len))
{
- if (len == strlen((const char *)type) &&
- !memcmp((const char *) type, s, len))
+ xmlChar *value = xmlNodeGetContent(n);
+ if (value && *value)
{
- xmlChar *value = xmlNodeGetContent(n);
- if (value && *value)
- {
- xmlFree(value);
+ if (!eq || strstr((const char *) value, eq+1))
match = 1;
- }
}
+ xmlFree(value);
}
xmlFree(type);
}
2
http://localhost:9763/search.pz2?session=4&command=show&start=0&number=1&block=1
http://localhost:9763/search.pz2?command=init&clear=1
-http://localhost:9763/search.pz2?session=5&command=settings&pz:name[z3950.indexdata.com%2Fmarc]=marc&pz:requestsyntax[z3950.indexdata.com%2Fmarc]=usmarc&pz:nativesyntax[z3950.indexdata.com%2Fmarc]=iso2709&pz:xslt[z3950.indexdata.com%2Fmarc]=marc21.xsl&pz:recordfilter[z3950.indexdata.com%2Fmarc]=date,title
+http://localhost:9763/search.pz2?session=5&command=settings&pz:name[z3950.indexdata.com%2Fmarc]=marc&pz:requestsyntax[z3950.indexdata.com%2Fmarc]=usmarc&pz:nativesyntax[z3950.indexdata.com%2Fmarc]=iso2709&pz:xslt[z3950.indexdata.com%2Fmarc]=marc21.xsl&pz:recordfilter[z3950.indexdata.com%2Fmarc]=date
http://localhost:9763/search.pz2?session=5&command=search&query=computer
+2
http://localhost:9763/search.pz2?session=5&command=show&start=0&number=1&block=1