@Test
  @Parameters(method = "getListOfRegionTestTypes")
  public void reindexThenQuery(RegionTestableType regionTestType) throws Exception {
    SerializableRunnableIF createIndex = () -> {
      LuceneService luceneService = LuceneServiceProvider.get(getCache());
      LuceneIndexFactoryImpl indexFactory =
          (LuceneIndexFactoryImpl) luceneService.createIndexFactory().addField("text");
      indexFactory.create(INDEX_NAME, REGION_NAME, true);
    };

    // Create dataRegion prior to index
    dataStore1.invoke(() -> initDataStore(regionTestType));
    dataStore2.invoke(() -> initDataStore(regionTestType));
    accessor.invoke(() -> initAccessor(regionTestType));

    // populate region
    putDataInRegion(accessor);

    // re-index stored data
    AsyncInvocation<Void> ai1 = dataStore1.invokeAsync(() -> {
      createIndex("text");
    });

    // re-index stored data
    AsyncInvocation<Void> ai2 = dataStore2.invokeAsync(() -> {
      createIndex("text");
    });

    ai1.join();
    ai2.join();

    ai1.checkException();
    ai2.checkException();

    waitForFlushBeforeExecuteTextSearch(accessor, 60000);
    executeTextSearch(accessor);
  }
This test class is intended to contain basic integration tests of the lucene query class that
should be executed against a number of different regions types and topologies.
geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesReindexDUnitTest.java