apiContent = blocks.text();
} else {
apiContent = document.select("p").text();
}
SearchEntry entry = new SearchEntry();
entry.setPublishAt(new Date(0L));
entry.setRawContent(apiContent);
entry.setSummary(apiContent.substring(0, Math.min(apiContent.length(), 500)));
entry.setTitle(document.title());
entry.setSubTitle(String.format("%s (%s API)", project.getName(), version.getVersion()));
entry.setPath(document.baseUri());
entry.setCurrent(version.isCurrent());
entry.setType("apiDoc");
entry.setVersion(version.getVersion());
entry.setProjectId(project.getId());
entry.addFacetPaths("Projects", "Projects/Api", "Projects/" + project.getName(), "Projects/"
+ project.getName() + "/" + version.getVersion());
return entry;
}