@Override
  public Collection<IndexRepository> getRepositories(RegionFunctionContext ctx,
      boolean waitForRepository) throws BucketNotFoundException {
    Region<Object, Object> region = ctx.getDataSet();
    int[] buckets = ((InternalRegionFunctionContext) ctx).getLocalBucketArray(region);
    if (buckets == null || buckets[0] == 0) {
      return null;
    }
    ArrayList<IndexRepository> repos = new ArrayList<>(buckets[0]);
    for (int i = 1; i <= buckets[0]; i++) {
      int bucketId = buckets[i];
      BucketRegion userBucket = userRegion.getDataStore().getLocalBucketById(bucketId);
      if (userBucket == null) {
        throw new BucketNotFoundException(
            "User bucket was not found for region " + region + "bucket id " + bucketId);
      } else {
        if (index.isIndexAvailable(userBucket.getId()) || userBucket.isEmpty()
            || waitForRepository) {
          repos.add(getRepository(userBucket.getId()));
        } else {
          waitingThreadPoolFromDM.execute(() -> {
            try {
              getRepository(userBucket.getId());
            } catch (Exception e) {
              logger.debug("Lucene Index creation in progress.", e);
            }
          });
          throw new LuceneIndexCreationInProgressException(
              "Lucene Index creation in progress for bucket: " + userBucket.getId());
        }
      }
    }

    return repos;
  }
The user region for this index
geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/PartitionedRepositoryManager.java