handle date range from a limit parameter PAZ-997
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 17 Apr 2015 12:05:37 +0000 (14:05 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 17 Apr 2015 12:05:37 +0000 (14:05 +0200)
The CCL term is not quoted unless it includes blanks. This will ensure
that r=r is handled correctly. This changes behavior a bit. If term
should not be converted to @and, then instead of r=r one should use
r=o or r=3 instead.

src/client.c
test/test_limit_limitmap_settings_2.xml

index dac30f2..e40c8e1 100644 (file)
@@ -1368,10 +1368,12 @@ static int apply_limit(struct session_database *sdb,
                             struct ccl_rpn_node *cn;
                             wrbuf_rewind(ccl_w);
                             wrbuf_puts(ccl_w, ccl);
-                            wrbuf_puts(ccl_w, "=\"");
+                            wrbuf_putc(ccl_w, '=');
+                            if (strchr(values[i], ' '))
+                                wrbuf_putc(ccl_w, '\"');
                             wrbuf_puts(ccl_w, values[i]);
-                            wrbuf_puts(ccl_w, "\"");
-
+                            if (strchr(values[i], ' '))
+                                wrbuf_putc(ccl_w, '\"');
                             cn = ccl_find_str(ccl_map, wrbuf_cstr(ccl_w),
                                               &cerror, &cpos);
                             if (cn)
index 1eb610b..3bfd24e 100644 (file)
@@ -23,7 +23,7 @@
   <set name="pz:cclmap:author_phrase" value="1=author_exact 6=3"/>
   <set name="pz:cclmap:term"  value="1=text s=Dal" />
   <set name="pz:cclmap:isbn"  value="1=isbn" />
-  <set name="pz:cclmap:date_exact"  value="1=date_exact r=r" />
+  <set name="pz:cclmap:date_exact"  value="1=date_exact r=o" />
   <set name="pz:xslt"  value="solr-pz2.xsl" />
   <set name="pz:queryencoding"  value="UTF-8" />