@Test
  public void shouldCreateRawIndexIfSpecifiedItsFactory()
      throws BucketNotFoundException, InterruptedException {
    Map<String, Analyzer> analyzers = new HashMap<>();

    final RecordingAnalyzer field1Analyzer = new RecordingAnalyzer();
    final RecordingAnalyzer field2Analyzer = new RecordingAnalyzer();
    analyzers.put("field1", field1Analyzer);
    analyzers.put("field2", field2Analyzer);
    LuceneServiceImpl.luceneIndexFactory = new LuceneRawIndexFactory();
    try {
      luceneService.createIndexFactory().setFields(analyzers).create(INDEX_NAME, REGION_NAME);
      Region region = createRegion();
      final LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME);
      assertThat(index).isInstanceOf(LuceneRawIndex.class);
      region.put("key1", new TestObject());
      verifyIndexFinishFlushing(cache, INDEX_NAME, REGION_NAME);
      assertEquals(analyzers, index.getFieldAnalyzers());
      assertEquals(new HashSet(Arrays.asList("field1")), field1Analyzer.analyzedfields);
      assertEquals(new HashSet(Arrays.asList("field2")), field2Analyzer.analyzedfields);
    } finally {
      LuceneServiceImpl.luceneIndexFactory = new LuceneIndexImplFactory();
    }
  }
Tests of creating lucene indexes on regions. All tests of index creation use cases should be in
classes starting with LuceneIndexCreation*. Most tests belong in this class, except for:
<ul>
<li>Tests that use persistence are in {@link LuceneIndexCreationPersistenceIntegrationTest}</li>
<li>Tests that use offheap are in {@link LuceneIndexCreationOffHeapIntegrationTest}</li>
</ul>
geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java