
marvin at rectangular
Mar 27, 2007, 11:16 PM
Post #1 of 1
(78 views)
Permalink
|
|
r2227 - trunk/c_src/KinoSearch/Index
|
|
Author: creamyg Date: 2007-03-28 00:16:15 -0700 (Wed, 28 Mar 2007) New Revision: 2227 Modified: trunk/c_src/KinoSearch/Index/MultiTermList.c trunk/c_src/KinoSearch/Index/SegTermList.c Log: Make sort caches produced by SegTermList and MultiTermList return -1 (unsuccessful) rather than 0 (a real document number) when the doc in quetion doesn't have a value for the sort field. Modified: trunk/c_src/KinoSearch/Index/MultiTermList.c =================================================================== --- trunk/c_src/KinoSearch/Index/MultiTermList.c 2007-03-28 07:13:32 UTC (rev 2226) +++ trunk/c_src/KinoSearch/Index/MultiTermList.c 2007-03-28 07:16:15 UTC (rev 2227) @@ -130,10 +130,15 @@ MultiTermList_build_sort_cache(MultiTermList *self, TermDocs *term_docs, u32_t max_doc) { - i32_t *ints = CALLOCATE(max_doc, i32_t); + i32_t *ints = MALLOCATE(max_doc, i32_t); i32_t num_index_terms = 0; ByteBuf **term_texts = MALLOCATE(((max_doc / 16) + 1), ByteBuf*); ByteBuf *last_term_text = BB_new(0); + i32_t i; + + for (i = 0; i < max_doc; i++) { + ints[i] = -1; + } MultiTermList_Reset(self); Modified: trunk/c_src/KinoSearch/Index/SegTermList.c =================================================================== --- trunk/c_src/KinoSearch/Index/SegTermList.c 2007-03-28 07:13:32 UTC (rev 2226) +++ trunk/c_src/KinoSearch/Index/SegTermList.c 2007-03-28 07:16:15 UTC (rev 2227) @@ -282,9 +282,14 @@ SegTermList_build_sort_cache(SegTermList *self, TermDocs *term_docs, u32_t max_doc) { - i32_t *ints = CALLOCATE(max_doc, i32_t); + i32_t *ints = MALLOCATE(max_doc, i32_t); i32_t term_num = 0; - + i32_t i; + + for (i = 0; i < max_doc; i++) { + ints[i] = -1; + } + SegTermList_Reset(self); while (SegTermList_Next(self)) {
|