- 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 */
+ /* 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.
+ */
+ int firstterm= *curterm;
+ int i;
+
+ for (i = 0; i<ct->no_children; i++)
+ {
+ rset_getterms(ct->children[i], terms, maxterms, curterm);
+ if ( ( *curterm > firstterm+1 ) &&
+ ( *curterm <= maxterms ) &&
+ ( terms[(*curterm)-1] == terms[firstterm] )
+ )
+ (*curterm)--; /* forget the term, seen that before */
+ }