@Test
public void shouldProvidePopulatorThatAcceptsDuplicateEntries() throws Exception
{
IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.defaults() );
withPopulator( indexProvider.getPopulator( descriptor, indexSamplingConfig ), p -> p.add( Arrays.asList(
add( 1, descriptor.schema(), "v1", "v2" ),
add( 2, descriptor.schema(), "v1", "v2" ) ) ) );
try ( IndexAccessor accessor = indexProvider.getOnlineAccessor( descriptor, indexSamplingConfig ) )
{
try ( IndexReader reader = new QueryResultComparingIndexReader( accessor.newReader() ) )
{
LongIterator nodes = reader.query( IndexQuery.exact( 1, "v1" ), IndexQuery.exact( 1, "v2" ) );
assertEquals( asSet( 1L, 2L ), PrimitiveLongCollections.toSet( nodes ) );
}
}
}
}