public IndexSearcher getNewIndexSearcherForProject(final String projectName) throws IOException { // Look through configured search indices to find one named projectName, and get the IndexSearcher for it. // Assumes that there's only one search index per project, or that the first one we meet here will be good // enough... LOG.debug("Trying to get new IndexSearcher for project " + projectName); final List searchIndices = OpenCms.getSearchManager().getSearchIndexes(); for (CmsSearchIndex index : searchIndices) { final String indexProjectName = index.getProject(); if (indexProjectName.equals(projectName)) { return new IndexSearcher(index.getPath()); } } LOG.error("No matching project for name >" + projectName + "< for which to create an IndexSearcher."); return null; }