in my old code i created public class BinDocValuesField extends Field {
/** * Type for numeric DocValues. */ public static final FieldType TYPE = new FieldType(); static { TYPE.setTokenized(false); TYPE.setOmitNorms(true); TYPE.setIndexOptions(IndexOptions.DOCS); TYPE.setStored(true); TYPE.setDocValuesType(DocValuesType.BINARY); TYPE.freeze(); } public BinDocValuesField(String name, byte[] value) { super(name, TYPE); fieldsData = new BytesRef(value); } } and in test code i created 4 documents adding BinDocValuesField fields where 2 docs has same binary and other 2 the same binary. executing TopGroups<?> tg = search.search(searcher, query, groupIndex, LIMIT ); now i have 4 groups instead of 2 groups. tg.totalGroupCount is correctly 2. any idea what can be changed?