Collection<VirtualFile> () { String stringToFind = getStringToFindInIndexes(myFindModel, myProject); if (stringToFind.isEmpty() || (DumbService.getInstance(myProject).isDumb() && !FileBasedIndex.isIndexAccessDuringDumbModeEnabled())) { return Collections.emptySet(); } final GlobalSearchScope scope = GlobalSearchScopeUtil.toGlobalSearchScope(FindInProjectUtil.getScopeFromModel(myProject, myFindModel), myProject); List<VirtualFile> hits = new ArrayList<>(); ThrowableComputable<TextSearchService.TextSearchResult, RuntimeException> findTextComputable = () -> myTextSearchService.processFilesWithText(stringToFind, Processors.cancelableCollectProcessor(hits), scope); TextSearchService.TextSearchResult result = DumbModeAccessType.RAW_INDEX_DATA_ACCEPTABLE.ignoreDumbMode(findTextComputable); if (result != TextSearchService.TextSearchResult.NO_TRIGRAMS) { return Collections.unmodifiableCollection(hits); } PsiSearchHelper helper = PsiSearchHelper.getInstance(myProject); CacheManager cacheManager = CacheManager.getInstance(myProject); return DumbModeAccessType.RAW_INDEX_DATA_ACCEPTABLE.ignoreDumbMode(() -> { Set<VirtualFile> resultFiles = new HashSet<>(); helper.processCandidateFilesForText(scope, UsageSearchContext.ANY, myFindModel.isCaseSensitive(), stringToFind, file -> { ContainerUtil.addIfNotNull(resultFiles, file); return true; }); // in case our word splitting is incorrect VirtualFile[] filesWithWord = cacheManager.getVirtualFilesWithWord(stringToFind, UsageSearchContext.ANY, scope, myFindModel.isCaseSensitive()); Collections.addAll(resultFiles, filesWithWord); return Collections.unmodifiableCollection(resultFiles); }); }