--- /dev/null
+# $Id: cqlpass.properties,v 1.1 2007-02-07 13:36:58 adam Exp $
+# Properties for pass-through index name to Bib-1 use attribute
+# Requires YAZ 2.1.49 or later.
+
+# Identifiers for prefixes used in this file. (index.*)
+set.cql = info:srw/cql-context-set/1/cql-v1.1
+set.pass = http://indexdata.dk/yaz/cqlpass
+
+# The default set when an index doesn't specify one: Dublin Core
+set = http://indexdata.dk/yaz/cqlpass
+
+# The default index when none is specified by the query
+index.cql.serverChoice = 1=1016
+
+index.pass.* = 1=*
+
+# Relation attributes are selected according to the CQL relation by
+# looking up the "relation.<relation>" property:
+#
+relation.< = 2=1
+relation.le = 2=2
+relation.eq = 2=3
+relation.exact = 2=3
+relation.ge = 2=4
+relation.> = 2=5
+relation.<> = 2=6
+
+# These two are what Zebra uses -- may not work on other servers
+relation.all = 4=6
+relation.any = 4=105
+
+# BIB-1 doesn't have a server choice relation, so we just make the
+# choice here, and use equality (which is clearly correct).
+relation.scr = 2=3
+
+# Relation modifiers.
+#
+relationModifier.relevant = 2=102
+relationModifier.fuzzy = 5=103
+ ### truncation=regExpr-2 (5=103) in Zebra is "fuzzy matching"
+relationModifier.stem = 2=101
+relationModifier.phonetic = 2=100
+
+# Non-standard extensions to provoke Zebra's inline sorting
+relationModifier.sort = 7=1
+relationModifier.sort-desc = 7=2
+relationModifier.numeric = 4=109
+
+# Position attributes may be specified for anchored terms (those
+# beginning with "^", which is stripped) and unanchored (those not
+# beginning with "^"). This may change when we get a BIB-1 truncation
+# attribute that says "do what CQL does".
+#
+position.first = 3=1 6=1
+ # "first in field"
+position.any = 3=3 6=1
+ # "any position in field"
+position.last = 3=4 6=1
+ # not a standard BIB-1 attribute
+position.firstAndLast = 3=3 6=3
+ # search term is anchored to be complete field
+
+# Structure attributes may be specified for individual relations; a
+# default structure attribute my be specified by the pseudo-relation
+# "*", to be used whenever a relation not listed here occurs.
+#
+structure.exact = 4=108
+ # string
+structure.all = 4=2
+structure.any = 4=2
+structure.* = 4=1
+ # phrase
+
+# Truncation attributes used to implement CQL wildcard patterns. The
+# simpler forms, left, right- and both-truncation will be used for the
+# simplest patterns, so that we produce PQF queries that conform more
+# closely to the Bath Profile. However, when a more complex pattern
+# such as "foo*bar" is used, we fall back on Z39.58-style masking.
+#
+truncation.right = 5=1
+truncation.left = 5=2
+truncation.both = 5=3
+truncation.none = 5=100
+truncation.regexp = 5=102
+truncation.z3958 = 5=104
+
+# Finally, any additional attributes that should always be included
+# with each term can be specified in the "always" property.
+#
+always = 6=1
+# 6=1: completeness = incomplete subfield
+
+
-/* $Id: cqltransform.c,v 1.26 2007-01-03 08:42:15 adam Exp $
+/* $Id: cqltransform.c,v 1.27 2007-02-07 13:36:58 adam Exp $
Copyright (C) 1995-2007, Index Data ApS
Index Data Aps
const char *cp0 = res, *cp1;
while ((cp1 = strchr(cp0, '=')))
{
+ int i;
while (*cp1 && *cp1 != ' ')
cp1++;
if (cp1 - cp0 >= sizeof(buf))
memcpy (buf, cp0, cp1 - cp0);
buf[cp1-cp0] = 0;
(*pr)("@attr ", client_data);
- (*pr)(buf, client_data);
+
+ for (i = 0; buf[i]; i++)
+ {
+ if (buf[i] == '*')
+ (*pr)(eval, client_data);
+ else
+ {
+ char tmp[2];
+ tmp[0] = buf[i];
+ tmp[1] = '\0';
+ (*pr)(tmp, client_data);
+ }
+ }
(*pr)(" ", client_data);
cp0 = cp1;
while (*cp0 == ' ')