-/* $Id: extract.c,v 1.189 2005-08-18 12:50:17 adam Exp $
+/* $Id: extract.c,v 1.193 2005-08-26 10:13:30 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
*sysno = rec->sysno;
recordAttr = rec_init_attr (zh->reg->zei, rec);
+ recordAttr->staticrank = extractCtrl.staticrank;
if (matchStr)
{
sizeof(*sysno), sysno);
}
extract_flushSortKeys (zh, *sysno, 1, &zh->reg->sortKeys);
- extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys, 0);
+ extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys,
+ recordAttr->staticrank);
zh->records_inserted++;
}
sortKeys.buf = rec->info[recInfo_sortKeys];
extract_flushSortKeys (zh, *sysno, 0, &sortKeys);
- extract_flushRecordKeys (zh, *sysno, 0, &delkeys, 0);
+ extract_flushRecordKeys (zh, *sysno, 0, &delkeys,
+ recordAttr->staticrank);
if (delete_flag)
{
/* record going to be deleted */
if (show_progress)
yaz_log (YLOG_LOG, "update %s %s %ld", recordType,
pr_fname, (long) recordOffset);
+ recordAttr->staticrank = extractCtrl.staticrank;
extract_flushSortKeys (zh, *sysno, 1, &zh->reg->sortKeys);
- extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys, 0);
+ extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys,
+ recordAttr->staticrank);
zh->records_updated++;
}
}
struct it_key key_out;
char *dst = (char*) &key_in;
zint *keyp = key_out.mem;
- size_t key_idx = 0;
iscz1_decode(decode_handle, &dst, &src);
assert(key_in.len == 4);
ZEBRA_RES zebra_snippets_rec_keys(ZebraHandle zh, struct recKeys *reckeys,
zebra_snippets *snippets)
{
- void *decode_handle = iscz1_start();
+ void *decode_handle = iscz1_start();
int off = 0;
int seqno = 0;
NMEM nmem = nmem_create();
- yaz_log(YLOG_LOG, "zebra_rec_keys_snippets buf=%p sz=%d", reckeys->buf,
- reckeys->buf_used);
assert(reckeys->buf);
while (off < reckeys->buf_used)
{
char *dst = (char*) &key;
char dst_buf[IT_MAX_WORD];
char *dst_term = dst_buf;
+ int index_type, ord;
iscz1_decode(decode_handle, &dst, &src);
assert(key.len <= 4 && key.len > 2);
seqno = (int) key.mem[key.len-1];
+ ord = key.mem[0];
- zebra_term_untrans_iconv(zh, nmem, src[0], &dst_term, src+1);
- zebra_snippets_append(snippets, seqno, src[0], key.mem[0], dst_term);
+ zebraExplain_lookup_ord(zh->reg->zei, ord, &index_type,
+ 0/* db */, 0/* set */, 0/* use */);
+ zebra_term_untrans_iconv(zh, nmem, index_type,
+ &dst_term, src);
+ zebra_snippets_append(snippets, seqno, ord, dst_term);
while (*src++)
;
off = src - reckeys->buf;
{
int set, use, slen;
- off += key_SU_decode(&set, sk->buf + off);
- off += key_SU_decode(&use, sk->buf + off);
- off += key_SU_decode(&slen, sk->buf + off);
+ off += key_SU_decode(&set, (unsigned char *) sk->buf + off);
+ off += key_SU_decode(&use, (unsigned char *) sk->buf + off);
+ off += key_SU_decode(&slen, (unsigned char *) sk->buf + off);
off += slen;
if (p->attrSet == set && p->attrUse == use)
return;
{
int set, use, slen;
- off += key_SU_decode(&set, sk->buf + off);
- off += key_SU_decode(&use, sk->buf + off);
- off += key_SU_decode(&slen, sk->buf + off);
+ off += key_SU_decode(&set, (unsigned char *) sk->buf + off);
+ off += key_SU_decode(&use, (unsigned char *) sk->buf + off);
+ off += key_SU_decode(&slen, (unsigned char *) sk->buf + off);
sortIdx_type(sortIdx, use);
if (cmd == 1)