@Test()
  public void throwFunctionExceptionWhenGivenBadQuery() throws Exception {
    LuceneService luceneService = LuceneServiceProvider.get(cache);
    region = createRegionAndIndex(RegionShortcut.PARTITION, "text");

    // Create a query that throws an exception
    final LuceneQuery<Object, Object> query =
        luceneService.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME, (index) -> {
          throw new LuceneQueryException("Bad query");
        });


    thrown.expect(LuceneQueryException.class);
    query.findPages();
  }
This class contains tests of lucene queries that can fit
geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/LuceneQueriesIntegrationTest.java