+ int i, r, max_pos;
+ char ord_buf[32];
+ RSET rset;
+ WRBUF term_dict = wrbuf_alloc();
+ int ord_len = key_SU_encode (ord, ord_buf);
+ int term_type = Z_Term_characterString;
+ const char *flags = "void";
+
+ wrbuf_putc(term_dict, '(');
+ for (i = 0; i<ord_len; i++)
+ {
+ wrbuf_putc(term_dict, 1);
+ wrbuf_putc(term_dict, ord_buf[i]);
+ }
+ wrbuf_putc(term_dict, ')');
+ wrbuf_puts(term_dict, term);
+
+ grep_info.isam_p_indx = 0;
+ r = dict_lookup_grep(zh->reg->dict, wrbuf_cstr(term_dict), 0,
+ &grep_info, &max_pos, 0, grep_handle);
+ yaz_log(YLOG_DEBUG, "%s %d positions", term,
+ grep_info.isam_p_indx);
+ rset = rset_trunc(zh, grep_info.isam_p_buf,
+ grep_info.isam_p_indx, term, strlen(term),
+ flags, 1, term_type, rset_nmem,
+ kc, kc->scope, 0, reg_type, 0 /* hits_limit */,
+ 0 /* term_ref_id_str */);
+ grep_info_delete(&grep_info);
+ wrbuf_destroy(term_dict);
+ return rset;