Corrected duplication of array's rows containing multiples docids (closes #3883)