summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0a23789)
For boolean operation, a op b, make CCL (a) op (b) rather than
(a op b), to ensure that proximity operator within a or be is only
applied there. This is to ensure that field assigment in a is
never applied to b in the resulting CQL. In CCL proximity has
higher precedence than field assignment, unlike CQL.
if (strcmp(value, "prox"))
{ /* not proximity. assuming boolean */
if (strcmp(value, "prox"))
{ /* not proximity. assuming boolean */
r = cql_to_ccl_r(cn->u.boolean.right, pr, client_data);
pr(")", client_data);
r = cql_to_ccl_r(cn->u.boolean.right, pr, client_data);
pr(")", client_data);
YAZ_CHECK(tst_query("title=x", "title=\"x\""));
YAZ_CHECK(tst_query("title=x or author=y",
YAZ_CHECK(tst_query("title=x", "title=\"x\""));
YAZ_CHECK(tst_query("title=x or author=y",
- "(title=\"x\" or author=\"y\")"));
+ "(title=\"x\") or (author=\"y\")"));
+ YAZ_CHECK(tst_query("title=x or author=y and date=z",
+ "((title=\"x\") or (author=\"y\")) and (date=\"z\")"));
YAZ_CHECK(tst_query("title all \"\"", "title=\"\""));
YAZ_CHECK(tst_query("title all \"\"", "title=\"\""));
YAZ_CHECK(tst_query("title any x", "title=\"x\""));
YAZ_CHECK(tst_query("title any x y", "title=\"x\" or title=\"y\""));
YAZ_CHECK(tst_query("title any \"x y\"", "title=\"x\" or title=\"y\""));
YAZ_CHECK(tst_query("title any x", "title=\"x\""));
YAZ_CHECK(tst_query("title any x y", "title=\"x\" or title=\"y\""));
YAZ_CHECK(tst_query("title any \"x y\"", "title=\"x\" or title=\"y\""));
+ YAZ_CHECK(tst_query("dc.title=encyclopedia prox dinosaurs",
+ "(dc.title=\"encyclopedia\") % (\"dinosaurs\")"));
}
int main(int argc, char **argv)
}
int main(int argc, char **argv)