protected void validateAllMembersAreTheSameVersion(PartitionedRegion region) {
    Set<InternalDistributedMember> remoteMembers = region.getRegionAdvisor().adviseAllPRNodes();
    final Version localVersion =
        cache.getDistributionManager().getDistributionManagerId().getVersion();
    if (!remoteMembers.isEmpty()) {
      for (InternalDistributedMember remoteMember : remoteMembers) {
        if (!remoteMember.getVersion().equals(localVersion)) {
          throw new IllegalStateException(
              "The lucene index cannot be created on a existing region if all members hosting the region : "
                  + region.getFullPath() + ", are not the same Apache Geode version ");
        }
      }
    }
  }
Implementation of LuceneService to create lucene index and query.


@since GemFire 8.5
geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java