From 80bae018835fc86eca7641fff3f8a7d9c8a2f1a5 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 4 May 2005 10:41:37 +0000 Subject: [PATCH] Fixed bug #316: Numerical sort does not work for search. We copy all attributes for attribute+term to sort attributes. --- index/zrpn.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/index/zrpn.c b/index/zrpn.c index 70fc703..799ae96 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -1,4 +1,4 @@ -/* $Id: zrpn.c,v 1.141.2.12 2005-05-03 14:07:45 adam Exp $ +/* $Id: zrpn.c,v 1.141.2.13 2005-05-04 10:41:37 adam Exp $ Copyright (C) 1995-2005 Index Data Aps @@ -1900,11 +1900,8 @@ static RSET rpn_sort_spec (ZebraHandle zh, Z_AttributesPlusTerm *zapt, int i; int sort_relation_value; AttrType sort_relation_type; - int use_value; - AttrType use_type; Z_SortKeySpec *sks; Z_SortKey *sk; - Z_AttributeElement *ae; int oid[OID_SIZE]; oident oe; char termz[20]; @@ -1912,9 +1909,6 @@ static RSET rpn_sort_spec (ZebraHandle zh, Z_AttributesPlusTerm *zapt, attr_init (&sort_relation_type, zapt, 7); sort_relation_value = attr_find (&sort_relation_type, &attributeSet); - attr_init (&use_type, zapt, 1); - use_value = attr_find (&use_type, &attributeSet); - if (!sort_sequence->specs) { sort_sequence->num_specs = 10; @@ -1950,21 +1944,7 @@ static RSET rpn_sort_spec (ZebraHandle zh, Z_AttributesPlusTerm *zapt, nmem_malloc (stream, sizeof(*sk->u.sortAttributes)); sk->u.sortAttributes->id = oid; - sk->u.sortAttributes->list = (Z_AttributeList *) - nmem_malloc (stream, sizeof(*sk->u.sortAttributes->list)); - sk->u.sortAttributes->list->num_attributes = 1; - sk->u.sortAttributes->list->attributes = (Z_AttributeElement **) - nmem_malloc (stream, sizeof(*sk->u.sortAttributes->list->attributes)); - ae = *sk->u.sortAttributes->list->attributes = (Z_AttributeElement *) - nmem_malloc (stream, sizeof(**sk->u.sortAttributes->list->attributes)); - ae->attributeSet = 0; - ae->attributeType = (int *) - nmem_malloc (stream, sizeof(*ae->attributeType)); - *ae->attributeType = 1; - ae->which = Z_AttributeValue_numeric; - ae->value.numeric = (int *) - nmem_malloc (stream, sizeof(*ae->value.numeric)); - *ae->value.numeric = use_value; + sk->u.sortAttributes->list = zapt->attributes; sks->sortRelation = (int *) nmem_malloc (stream, sizeof(*sks->sortRelation)); -- 1.7.10.4