From 744a00b201a04b308f22fad1ece422b97d2cdd50 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Wed, 11 Sep 2013 10:50:24 +0200 Subject: [PATCH] Fix check on same index. Convert reversed into ranges as well --- src/rpn2solr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpn2solr.c b/src/rpn2solr.c index 6e41001..076e3a9 100644 --- a/src/rpn2solr.c +++ b/src/rpn2solr.c @@ -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 && - !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) return solr_write_range(pr, client_data, solr_attr_left, solr_attr_right); + else if (solr_attr_left->is_range <= 2 && solr_attr_right->is_range >= 2) + 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); -- 1.7.10.4