projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change yaz_filepath_resolve for path="" (empty)
[yaz-moved-to-github.git]
/
src
/
rpn2solr.c
diff --git
a/src/rpn2solr.c
b/src/rpn2solr.c
index
6390ebb
..
70b2f6c
100644
(file)
--- a/
src/rpn2solr.c
+++ b/
src/rpn2solr.c
@@
-184,7
+184,10
@@
static int checkForTruncation(int flag, Z_AttributeList *attributes)
if (truncation <= 3)
return ((int) truncation & flag);
}
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 */
}
}
/* No truncation or unsupported */
@@
-192,11
+195,11
@@
static int checkForTruncation(int flag, Z_AttributeList *attributes)
};
static int checkForLeftTruncation(Z_AttributeList *attributes) {
};
static int checkForLeftTruncation(Z_AttributeList *attributes) {
- return checkForTruncation(1, attributes);
+ return checkForTruncation(2, attributes);
}
static int checkForRightTruncation(Z_AttributeList *attributes) {
}
static int checkForRightTruncation(Z_AttributeList *attributes) {
- return checkForTruncation(2, attributes);
+ return checkForTruncation(1, attributes);
};
static int rpn2solr_simple(solr_transform_t ct,
};
static int rpn2solr_simple(solr_transform_t ct,
@@
-242,6
+245,7
@@
static int rpn2solr_simple(solr_transform_t ct,
{
size_t i;
int must_quote = 0;
{
size_t i;
int must_quote = 0;
+
for (i = 0 ; i < lterm; i++)
if (sterm[i] == ' ')
must_quote = 1;
for (i = 0 ; i < lterm; i++)
if (sterm[i] == ' ')
must_quote = 1;
@@
-250,7
+254,13
@@
static int rpn2solr_simple(solr_transform_t ct,
/* Bug 2878: Check and add Truncation */
if (checkForLeftTruncation(apt->attributes))
wrbuf_puts(w, "*");
/* Bug 2878: Check and add Truncation */
if (checkForLeftTruncation(apt->attributes))
wrbuf_puts(w, "*");
- wrbuf_write(w, sterm, lterm);
+ for (i = 0 ; i < lterm; i++) {
+ /* BUG 4415: Escape special characters in string terms */
+ if (strchr("+-&|!(){}[]^\"~*?:\\", sterm[i])) {
+ wrbuf_putc(w, '\\');
+ }
+ wrbuf_putc(w, sterm[i]);
+ }
/* Bug 2878: Check and add Truncation */
if (checkForRightTruncation(apt->attributes))
wrbuf_puts(w, "*");
/* Bug 2878: Check and add Truncation */
if (checkForRightTruncation(apt->attributes))
wrbuf_puts(w, "*");