+
+static void r_get_terms(RSET ct, TERMID *terms, int maxterms, int *curterm)
+ /* Special case: Some multi-ors have all terms pointing to the same */
+ /* term. We do not want to duplicate those. Other multiors (and ands) */
+ /* have different terms under them. Those we want. */
+{
+ struct rset_multiandor_info *info =
+ (struct rset_multiandor_info *) ct->priv;
+ int firstterm= *curterm;
+ int i;
+ for (i=0;i<info->no_rsets;i++)
+ {
+ rset_getterms(info->rsets[i], terms, maxterms, curterm);
+ yaz_log(LOG_DEBUG,"rsmulti: getterms: i=%d *cur=%d",i,*curterm);
+ /* FIXME - remove this log once we know it works */
+ if ( ( (*curterm) > firstterm+1 ) &&
+ ( (*curterm) <= maxterms ) &&
+ ( terms[(*curterm)-1] == terms[firstterm] ) )
+ *curterm--; /* forget the term, seen that before */
+ }
+}
+
+