private void handleIfRetryNeededOnException(LuceneIndexCreationInProgressException ex,
      RegionFunctionContext ctx) {
    PartitionedRegion userDataRegion = (PartitionedRegion) ctx.getDataSet();

    // get the remote members
    Set<InternalDistributedMember> remoteMembers =
        userDataRegion.getRegionAdvisor().adviseAllPRNodes();
    // Old members with version numbers 1.6 or lower cannot handle IndexCreationInProgressException
    // Hence the query waits for the repositories to be ready instead of throwing the exception
    if (!remoteMembers.isEmpty()) {
      for (InternalDistributedMember remoteMember : remoteMembers) {
        if (remoteMember.getVersion().ordinal() < KnownVersion.GEODE_1_6_0.ordinal()) {
          // re-execute but wait till indexing is complete
          execute(ctx, true);
          return;
        }
      }
    }
    // Cannot send IndexingInProgressException as the function may have been executed a new server
    // on behalf of an old version client.
    throw new FunctionException(new LuceneQueryException(
        "Lucene Index is not available, currently indexing"));
  }
{@link LuceneQueryFunction} coordinates text search on a member. It receives text search query
from the coordinator and arguments like region and buckets. It invokes search on the local index
and provides a result collector. The locally collected results are sent to the search
coordinator.
geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneQueryFunction.java