projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9b2915
)
Fix PQF to Solr conversion may produce invalid Solr query YAZ-792
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 7 Oct 2014 17:38:42 +0000
(19:38 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 7 Oct 2014 17:38:42 +0000
(19:38 +0200)
Just deal with the empty PQF term and quote that as well.
src/rpn2solr.c
patch
|
blob
|
history
diff --git
a/src/rpn2solr.c
b/src/rpn2solr.c
index
f790ea2
..
1a39204
100644
(file)
--- a/
src/rpn2solr.c
+++ b/
src/rpn2solr.c
@@
-228,9
+228,14
@@
static int emit_term(solr_transform_t ct, WRBUF w, Z_Term *term, Odr_int trunc)
size_t i;
int must_quote = 0;
- for (i = 0 ; i < lterm; i++)
- if (sterm[i] == ' ')
- must_quote = 1;
+ if (lterm == 0)
+ must_quote = 1;
+ else
+ {
+ for (i = 0 ; i < lterm; i++)
+ if (sterm[i] == ' ')
+ must_quote = 1;
+ }
if (must_quote)
wrbuf_puts(w, "\"");
if (trunc == 2 || trunc == 3)