From: Mike Taylor Date: Tue, 5 Jul 2011 22:42:31 +0000 (+0100) Subject: The static function bool(), which is part of cql_to_ccl_r(), now makes X-Git-Tag: v4.2.5~16 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=443e78f2e7d7894a1a9cb3cac79e4b1a84ec7a11;p=yaz-moved-to-github.git The static function bool(), which is part of cql_to_ccl_r(), now makes some attempt to recognise and deal with proximity. Right now, all it does it recognise the CQL operator name "prox" and map it to the CCL operator "!" rather than the unrecognised plain word "prox" -- this suffices to get SOME indication of proximity into the resulting CCL, which is a big step forward for bug #4407. We ought to check for a an /ordered=0 relation modifier and emit "%" instead in that case. --- diff --git a/src/cql2ccl.c b/src/cql2ccl.c index f427e7c..4a3932e 100644 --- a/src/cql2ccl.c +++ b/src/cql2ccl.c @@ -133,15 +133,19 @@ static int bool(struct cql_node *cn, void (*pr)(const char *buf, void *client_data), void *client_data) { + char *value = cn->u.boolean.value; int r; + /* Rather lame initial attempt at interpreting proximity */ + if (!strcmp(value, "prox")) value = "!"; + pr("(", client_data); r = cql_to_ccl_r(cn->u.boolean.left, pr, client_data); if (r) return r; pr(" ", client_data); - pr(cn->u.boolean.value, client_data); + pr(value, client_data); pr(" ", client_data); r = cql_to_ccl_r(cn->u.boolean.right, pr, client_data);