}
}
if (server_choice)
- return "solr.serverChoice";
+ return "cql.serverChoice";
return 0;
}
}
static int rpn2solr_attr(solr_transform_t ct,
- Z_AttributeList *attributes, WRBUF w)
+ Z_AttributeList *attributes, WRBUF w, char **close_range)
{
const char *relation = solr_lookup_reverse(ct, "relation.", attributes);
const char *index = solr_lookup_reverse(ct, "index.", attributes);
if (!index)
{
- solr_transform_set_error(ct,
- YAZ_BIB1_UNSUPP_USE_ATTRIBUTE, 0);
+ solr_transform_set_error(ct, YAZ_BIB1_UNSUPP_USE_ATTRIBUTE, 0);
return -1;
}
/* for serverChoice we omit index+relation+structure */
- if (strcmp(index, "solr.serverChoice"))
+ if (strcmp(index, "cql.serverChoice"))
{
wrbuf_puts(w, index);
if (relation)
else if (!strcmp(relation, "eq"))
relation = ":";
else if (!strcmp(relation, "le")) {
- /* TODO Not support as such, but could perhaps be transformed into a range
- relation = ":[ * to ";
- close_range = "]"
- */
+ /* TODO Not support as such, but could perhaps be transformed into a range */
+ relation = ":[* TO ";
+ *close_range = "]";
}
else if (!strcmp(relation, "ge")) {
- /* TODO Not support as such, but could perhaps be transformed into a range
- relation = "[";
- relation = ":[ * to ";
- close_range = "]"
- */
+ /* TODO Not support as such, but could perhaps be transformed into a range */
+ relation = ":[";
+ *close_range = " TO *]";
}
/* Missing mapping of not equal, phonetic, stem and relevance */
wrbuf_puts(w, relation);
wrbuf_puts(w, " ");
}
}
+// if (close_range)
+// wrbuf_puts(w, close_range);
}
return 0;
}
Odr_int trunc = get_truncation(apt);
wrbuf_rewind(w);
- ret = rpn2solr_attr(ct, apt->attributes, w);
+ char *close_range = 0;
+ ret = rpn2solr_attr(ct, apt->attributes, w, &close_range);
if (trunc == 0 || trunc == 1 || trunc == 100 || trunc == 104)
;
wrbuf_puts(w, "*");
if (must_quote)
wrbuf_puts(w, "\"");
+ if (close_range)
+ wrbuf_puts(w, close_range);
}
if (ret == 0)
pr(wrbuf_cstr(w), client_data);