Allow r=omiteq to omit 2=3 for generated PQF YAZ-766
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 29 May 2014 15:06:37 +0000 (17:06 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 29 May 2014 15:06:37 +0000 (17:06 +0200)
include/yaz/ccl.h
src/cclfind.c
src/cclqfile.c

index 5b9ac5c..d701095 100644 (file)
@@ -358,6 +358,7 @@ struct ccl_rpn_attr *ccl_parser_qual_search(CCL_parser cclp, const char *name,
 #define CCL_BIB1_STR_AUTO_GROUP (-4)
 #define CCL_BIB1_REL_ORDER (-1)
 #define CCL_BIB1_REL_PORDER (-2)
+#define CCL_BIB1_REL_OMIT_EQUALS (-3)
 
 #define CCL_BIB1_TRU_CAN_LEFT (-1)
 #define CCL_BIB1_TRU_CAN_RIGHT (-2)
index 1d4f6c6..a5bde82 100644 (file)
@@ -799,7 +799,9 @@ struct ccl_rpn_node *qualifiers_order(CCL_parser cclp,
     {
         if (!(p = search_terms(cclp, ap)))
             return NULL;
-        ccl_add_attr_numeric(p, attset, CCL_BIB1_REL, rel);
+        if (rel != 3 ||
+            !qual_val_type(ap, CCL_BIB1_REL, CCL_BIB1_REL_OMIT_EQUALS, 0))
+            ccl_add_attr_numeric(p, attset, CCL_BIB1_REL, rel);
         return p;
     }
     return NULL;
index 943f84d..df98f33 100644 (file)
@@ -132,6 +132,8 @@ int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name,
                         value = CCL_BIB1_REL_ORDER;
                     else if (!ccl_stricmp (value_str, "r"))
                         value = CCL_BIB1_REL_PORDER;
+                    else if (!ccl_stricmp (value_str, "omiteq"))
+                        value = CCL_BIB1_REL_OMIT_EQUALS;
                     break;
                 case 'p':
                 case 'P':