Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 11 Apr 2011 09:20:10 +0000 (11:20 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 11 Apr 2011 09:20:10 +0000 (11:20 +0200)
src/rpn2cql.c
src/rpn2solr.c
test/test_rpn2cql.c
test/test_rpn2solr.c
win/makefile
win/yaz.nsi
win/yaz.win32.nsi
win/yaz.win64.nsi

index ea21793..b1063a1 100644 (file)
@@ -182,11 +182,11 @@ static int checkForTruncation(int flag, Z_AttributeList *attributes)
 };
 
 static int checkForLeftTruncation(Z_AttributeList *attributes) {
-       return checkForTruncation(1, attributes);
+       return checkForTruncation(2, attributes);
 }
 
 static int checkForRightTruncation(Z_AttributeList *attributes) {
-       return checkForTruncation(2, attributes);
+       return checkForTruncation(1, attributes);
 };
 
 static int rpn2cql_simple(cql_transform_t ct,
index 6390ebb..89b8b91 100644 (file)
@@ -184,7 +184,10 @@ static int checkForTruncation(int flag, Z_AttributeList *attributes)
                if (truncation <= 3)
                     return ((int) truncation & flag);
             }
-            /* Complex: Shouldn't happen */
+            else if (ae->which == Z_AttributeValue_complex) {
+                //yaz_log(YLOG_DEBUG, "Z_Attribute_complex");
+                /* Complex: Shouldn't happen */
+            }
         }
     }
     /* No truncation or unsupported */
@@ -192,11 +195,11 @@ static int checkForTruncation(int flag, Z_AttributeList *attributes)
 };
 
 static int checkForLeftTruncation(Z_AttributeList *attributes) {
-       return checkForTruncation(1, attributes);
+       return checkForTruncation(2, attributes);
 }
 
 static int checkForRightTruncation(Z_AttributeList *attributes) {
-       return checkForTruncation(2, attributes);
+       return checkForTruncation(1, attributes);
 };
 
 static int rpn2solr_simple(solr_transform_t ct,
index cb2dacb..bdb4972 100644 (file)
@@ -82,15 +82,19 @@ static void tst2(void)
     YAZ_CHECK(compare(ct, "@attr 1=4 abc", "dc.title=abc"));
     YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=108 abc", "dc.title=/exact abc"));
     YAZ_CHECK(compare(ct, "@attr 1=4 @attr 3=1 @attr 6=1 abc", "dc.title=abc"));
-    YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=1 @attr 6=1 abc",
-                      "dc.title=abc"));
+    YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=1 @attr 6=1 abc", "dc.title=abc"));
     YAZ_CHECK(compare(ct, "@attr 1=1016 abc", "abc"));
+    /* Date tests */
     YAZ_CHECK(compare(ct, "@attr 2=1 @attr 1=30 1980", "dc.date<1980"));
     YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=3 1980", "dc.date=1980"));
     YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=5 1980", "dc.date>1980"));
     YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=2 1980", "dc.date<=1980"));
     YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=4 1980", "dc.date>=1980"));
-
+    /* Truncation */
+    YAZ_CHECK(compare(ct, "@attr 5=1 water", "water*"));
+    YAZ_CHECK(compare(ct, "@attr 5=2 water", "*water"));
+    YAZ_CHECK(compare(ct, "@attr 5=3 water", "*water*"));
+    /* Other */
     YAZ_CHECK(compare(ct, "@attr 2=103 @attr 1=_ALLRECORDS 1", "cql.allRecords=1"));
     YAZ_CHECK(compare(ct, "@attr 1=500 abc", 0));
     cql_transform_close(ct);
index a5956dd..1fc1695 100644 (file)
@@ -70,6 +70,12 @@ static void tst1(void)
 
     solr_transform_define_pattern(ct, "index.foo", "1=bar");
     YAZ_CHECK(compare(ct, "@attr 1=bar abc", "foo:abc"));
+
+    /* Truncation */
+    YAZ_CHECK(compare(ct, "@attr 5=1 water", "water*"));
+    YAZ_CHECK(compare(ct, "@attr 5=2 water", "*water"));
+    YAZ_CHECK(compare(ct, "@attr 5=3 water", "*water*"));
+
     /*
     YAZ_CHECK(compare(ct, "@or @attr 1=1016 water @attr 7=1 @attr 1=4 0", "any:water rank:??");
      */
index b850872..05269e8 100644 (file)
@@ -52,9 +52,12 @@ dist: yaz.win32.nsi yaz.nsi distclean
        $(NSIS) yaz.win32.nsi
 
 dist64: yaz.win64.nsi yaz.nsi distclean
-       nmake DEBUG=0 HAVE_LIBXSLT=1 HAVE_LIBXML2=1 HAVE_ICONV=0 HAVE_ICU=1 LIBXML2_DIR=c:\libxml2-2.7.8.win64 LIBXSLT_DIR=c:\libxslt-1.1.26.win64 ICU_LIB=\icu64\lib64 ICU_INCLUDE=\icu64\include ICU_BIN=\icu64\bin64
+       nmake make64
        $(NSIS) yaz.win64.nsi 
 
+make64:
+       nmake DEBUG=0 HAVE_LIBXSLT=1 HAVE_LIBXML2=1 HAVE_ICONV=0 HAVE_ICU=1 LIBXML2_DIR=c:\libxml2-2.7.8.win64 LIBXSLT_DIR=c:\libxslt-1.1.26.win64 ICU_LIB=\icu64\lib64 ICU_INCLUDE=\icu64\include ICU_BIN=\icu64\bin64
+
 distclean:
        nmake DEBUG=1 clean
        nmake DEBUG=0 clean
index be73f62..9e45f74 100644 (file)
@@ -37,7 +37,6 @@ ComponentText "This will install the YAZ Toolkit on your computer:"
 InstType "Full (w/ Source)"
 InstType "Lite (w/o Source)"
 
-InstallDir "$PROGRAMFILES\YAZ"
 InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" ""
 
 
index dfa475c..15c3843 100644 (file)
@@ -2,5 +2,7 @@
 !define VS_RUNTIME_DLL      "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\msvc*90.dll"
 !define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest"
 
+InstallDir "$PROGRAMFILES\YAZ"
+
 !include yaz.nsi
 
index c2be7d4..63208ba 100644 (file)
@@ -2,5 +2,7 @@
 !define VS_RUNTIME_DLL      "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\amd64\Microsoft.VC90.CRT\msvc*90.dll"
 !define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\amd64\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest"
 
+InstallDir "$PROGRAMFILES64\YAZ"
+
 !include yaz.nsi