- rset_null_parms parms;
- parms.rset_term = rset_term_create (term, length, flags, term_type);
- return rset_create (rset_kind_null, &parms);
- }
- if (zi->reg->isams)
- {
- if (no == 1)
- {
- rset_isams_parms parms;
-
- parms.pos = *isam_p;
- parms.is = zi->reg->isams;
- parms.rset_term = rset_term_create (term, length, flags,
- term_type);
- return rset_create (rset_kind_isams, &parms);
- }
- qsort (isam_p, no, sizeof(*isam_p), isams_trunc_cmp);
- }
- else if (zi->reg->isamc)
- {
- if (no == 1)
- {
- rset_isamc_parms parms;
-
- parms.key_size = sizeof(struct it_key);
- parms.cmp = key_compare_it;
- parms.pos = *isam_p;
- parms.is = zi->reg->isamc;
- parms.rset_term = rset_term_create (term, length, flags,
- term_type);
- return rset_create (rset_kind_isamc, &parms);
- }
-#if NEW_TRUNC
- else if (no < 10000)
- {
- rset_m_or_parms parms;
-
- parms.key_size = sizeof(struct it_key);
- parms.cmp = key_compare_it;
- parms.isc = zi->reg->isamc;
- parms.isam_positions = isam_p;
- parms.no_isam_positions = no;
- parms.no_save_positions = 100000;
- parms.rset_term = rset_term_create (term, length, flags,
- term_type);
- return rset_create (rset_kind_m_or, &parms);
- }
-#endif
- qsort (isam_p, no, sizeof(*isam_p), isamc_trunc_cmp);
- }
- else if (zi->reg->isamb)
- {
- if (no == 1)
- {
- rset_isamb_parms parms;
-
- parms.key_size = sizeof(struct it_key);
- parms.cmp = key_compare_it;
- parms.pos = *isam_p;
- parms.is = zi->reg->isamb;
- parms.rset_term = rset_term_create (term, length, flags,
- term_type);
- return rset_create (rset_kind_isamb, &parms);
- }
- qsort (isam_p, no, sizeof(*isam_p), isamc_trunc_cmp);
+ RSET r;
+ RSET *rsets = xmalloc(no*sizeof(RSET)); /* use nmem! */
+ int i;
+ for (i = 0; i<no; i++)
+ rsets[i] = rsisamb_create(rset_nmem, kctrl, scope,
+ zh->reg->isamb, isam_p[i],
+ 0 /* termid */);
+ r = rset_create_or(rset_nmem, kctrl, scope,
+ termid, no, rsets);
+ xfree(rsets);
+ return r;