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
Fix return correct relation when not using configuration file
[yaz-moved-to-github.git]
/
src
/
rpn2solr.c
diff --git
a/src/rpn2solr.c
b/src/rpn2solr.c
index
6e41001
..
7fe0797
100644
(file)
--- a/
src/rpn2solr.c
+++ b/
src/rpn2solr.c
@@
-69,15
+69,15
@@
static const char *lookup_relation_index_from_attr(Z_AttributeList *attributes)
{
/* Unsure on whether this is the relation attribute constants? */
case Z_ProximityOperator_Prox_lessThan:
{
/* Unsure on whether this is the relation attribute constants? */
case Z_ProximityOperator_Prox_lessThan:
- return 0;
+ return "<";
case Z_ProximityOperator_Prox_lessThanOrEqual:
case Z_ProximityOperator_Prox_lessThanOrEqual:
- return 0;
+ return "le";
case Z_ProximityOperator_Prox_equal:
return ":";
case Z_ProximityOperator_Prox_greaterThanOrEqual:
case Z_ProximityOperator_Prox_equal:
return ":";
case Z_ProximityOperator_Prox_greaterThanOrEqual:
- return 0;
+ return "ge";
case Z_ProximityOperator_Prox_greaterThan:
case Z_ProximityOperator_Prox_greaterThan:
- return 0;
+ return ">";
case Z_ProximityOperator_Prox_notEqual:
return 0;
case 100:
case Z_ProximityOperator_Prox_notEqual:
return 0;
case 100:
@@
-159,12
+159,12
@@
static int rpn2solr_attr(solr_transform_t ct,
solr_attr->close = "]";
}
else if (!strcmp(relation, "ge")) {
solr_attr->close = "]";
}
else if (!strcmp(relation, "ge")) {
- solr_attr->is_range = 3;
+ solr_attr->is_range = 4;
solr_attr->begin = "[";
solr_attr->close = " TO *]";
}
else if (!strcmp(relation, ">")) {
solr_attr->begin = "[";
solr_attr->close = " TO *]";
}
else if (!strcmp(relation, ">")) {
- solr_attr->is_range = 4;
+ solr_attr->is_range = 5;
solr_attr->begin = "{";
solr_attr->close = " TO *]";
}
solr_attr->begin = "{";
solr_attr->close = " TO *]";
}
@@
-351,10
+351,12
@@
static int solr_write_and_or_range(void (*pr)(const char *buf, void *client_data
{
if (solr_attr_left->is_range &&
solr_attr_right->is_range &&
{
if (solr_attr_left->is_range &&
solr_attr_right->is_range &&
- !strcmp(solr_attr_left->index, solr_attr_left->index))
+ !strcmp(solr_attr_left->index, solr_attr_right->index))
{
{
- if (solr_attr_left->is_range >= 3 && solr_attr_right->is_range <= 2)
+ if (solr_attr_left->is_range > 3 && solr_attr_right->is_range < 3)
return solr_write_range(pr, client_data, solr_attr_left, solr_attr_right);
return solr_write_range(pr, client_data, solr_attr_left, solr_attr_right);
+ else if (solr_attr_left->is_range < 3 && solr_attr_right->is_range > 3)
+ return solr_write_range(pr, client_data, solr_attr_right, solr_attr_left);
}
solr_write_structure(pr, client_data, solr_attr_left);
pr(" AND ", client_data);
}
solr_write_structure(pr, client_data, solr_attr_left);
pr(" AND ", client_data);