+
+ /* determine database from the term, but only bother if more than
+ one database is in use*/
+ if (numbases > 1 && termid->ol)
+ {
+ const char *this_db = 0;
+ if (zebraExplain_lookup_ord(zh->reg->zei, termid->ol->ord, 0, &this_db, 0)
+ == 0 && this_db)
+ {
+ for (ib = 0; ib < numbases; ib++)
+ if (!strcmp(this_db, zh->basenames[ib]))
+ database_no = ib;
+ }
+ }
+#if 0
+ yaz_log(YLOG_LOG, "sysno=" ZINT_FORMAT " database_no=%d", this_sys,
+ database_no);
+ ord_list_print(termid->ol);
+#endif
+ resultSetInsertSort(zh, sset, database_no,