private ResultModel getResults(int fromIndex, int toIndex, boolean keysonly) throws Exception {
    ResultModel result = new ResultModel();
    TabularResultModel table = result.addTable("lucene-indexes");
    for (int i = fromIndex; i < toIndex; i++) {
      if (!searchResults.get(i).getExceptionFlag()) {
        table.accumulate("key", searchResults.get(i).getKey());
        if (!keysonly) {
          table.accumulate("value", searchResults.get(i).getValue());
          table.accumulate("score", Float.toString(searchResults.get(i).getScore()));
        }
      } else {
        throw new UserErrorException(searchResults.get(i).getExceptionMessage());
      }
    }
    return result;
  }
Internally, we verify the resource operation permissions DATA:READ:[RegionName]
geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/commands/LuceneSearchIndexCommand.java