The index generating code has problems both with
multiple names pointing to the same doc (because we
feed it the value set and hence use only the real
names) and with multiple docs pointed to by the same
name (because we store it in sets so "there can be only
one"...).