* When an error occurs communicating with the Solr server instance.
*/
public void indexAll(boolean delete) {
LOG.info("Indexing products...");
try {
XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL(
this.fmUrl));
LOG.info("Retrieving list of product types.");
List<ProductType> types = fmClient.getProductTypes();
for (ProductType type : types) {
if (!config.getIgnoreTypes().contains(type.getName().trim())) {
LOG.info("Paging through products for product type: "
+ type.getName());
for (ProductPage page = safeFirstPage(fmClient, type); page != null && !page
.isLastPage(); page = fmClient.getNextPage(type, page)) {
for (Product product : page.getPageProducts()) {
try {
this.indexProduct(product.getProductId(), fmClient
.getMetadata(product), type.getTypeMetadata());
} catch (Exception e) {
LOG.severe("Could not index " + product.getProductId() + ": "
+ e.getMessage());
}