public static <K, V extends Comparable> List<IndexedRelevantResource<K, V>> getResources(ID<K, V> indexId,
                                                                                           final K key,
                                                                                           final @Nullable Module module,
                                                                                           @NotNull Project project,
                                                                                           final @Nullable GlobalSearchScope additionalScope) {

    if (project.isDefault()) return Collections.emptyList();
    final ArrayList<IndexedRelevantResource<K, V>> resources = new ArrayList<>();
    final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
    FileBasedIndex.getInstance().processValues(indexId, key, null, (file, value) -> {
      ResourceRelevance relevance = ResourceRelevance.getRelevance(file, module, fileIndex, additionalScope);
      resources.add(new IndexedRelevantResource<>(file, key, value, relevance));
      return true;
    }, new AdditionalIndexedRootsScope(GlobalSearchScope.allScope(project)));
    return resources;
  }
public static <K, V extends Comparable> List<IndexedRelevantResource<K, V>> getResources(ID<K, V> indexId,
                                                                                           final K key,
                                                                                           final @Nullable Module module,
                                                                                           @NotNull Project project,
                                                                                           final @Nullable GlobalSearchScope additionalScope)