]> mj.ucw.cz Git - libucw.git/commitdiff
Added secondary sorting (i.e., breaking ties when two documents have the same Q)
authorMartin Mares <mj@ucw.cz>
Sat, 20 Apr 2002 15:09:41 +0000 (15:09 +0000)
committerMartin Mares <mj@ucw.cz>
Sat, 20 Apr 2002 15:09:41 +0000 (15:09 +0000)
on any of the custom attributes. Just define CUSTOM_SORTING in lib/custom.h.

I've also removed secondary sorting of result heap by site ID inside refs.c
-- according to my best knowledge it wasn't required anywhere.

Maybe we can remove the CUSTOM_SORTING switch and just leave the sec_sort_key
in struct result_note initialized to zero, but it would cost us 4 bytes per
result_note which I wanted to avoid.

lib/custom.h
lib/index.h

index f4a57115aae467872ce9fd6d65507fba28f0fe1a..250a7bac19afc6636efac7ce32aff61cfc26e050 100644 (file)
@@ -98,6 +98,9 @@ enum string_type {
  *  A good place for definitions of the functions is lib/custom.c.
  *
  *  Please order the attributes by decreasing size to get optimum padding.
+ *
+ *  If you also want the search server to sort by a custom attribute
+ *  on ties, define CUSTOM_SORTING.
  */
 
 #if 0          /* Example */
@@ -108,6 +111,8 @@ struct card_attr;
 void custom_get_lm(struct card_attr *ca, byte *attr);
 byte *custom_parse_lm(u32 *dest, byte *value, uns intval);
 
+#define CUSTOM_SORTING
+
 #else
 
 #define CUSTOM_ATTRS
index dc8dab1a8a331007ecc1bb54072870c4c28e130b..6a22cf17b3b66149120b493cc44e2b2e619cb8c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Sherlock: Data structures used in indices
  *
- *     (c) 2001 Martin Mares <mj@ucw.cz>
+ *     (c) 2001--2002 Martin Mares <mj@ucw.cz>
  */
 
 /* Words */