loading table of contents...

Search Manual / Version 2207

Table Of Contents

5.5 Integrating a Different Search Engine

This section describes the necessary steps to make the CAE Feeder feed content bean data to a different search engine or another external system. The default integration uses Apache Solr but the CAE Feeder provides an Indexer interface that can be implemented to feed other external systems such as a search engine that is integrated in your company's IT infrastructure.

The following simple example explains how you can replace the standard Apache Solr indexer with a custom indexer that just writes messages to the log file.

  1. Create a new Maven module, for example caefeeder-custom-component with the following pom.xml:

      <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" 







  1. Create a new source folder src/main/java in the module.

  2. Create the java class LogIndexer for the new indexer in package com/customer:

      package com.customer;
import com.coremedia.cap.feeder.Feedable;
import com.coremedia.cap.feeder.FeedableElement;
import com.coremedia.cap.feeder.index.IndexException;
import com.coremedia.cap.feeder.index.IndexerResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
public class LogIndexer extends DirectIndexerBase {
  private static final Logger LOG 
    = LoggerFactory.getLogger(LogIndexer.class);
  public IndexerResult index(
      Collection<? extends Feedable> feedables, 
      Collection<String> removeIds) throws IndexException {
    if (LOG.isInfoEnabled()) {
      for (Feedable feedable: feedables) {
        Collection<FeedableElement> elements
          = feedable.getElements();
        Map<String, Object> values
          = new HashMap<>(elements.size());
        for (FeedableElement element: elements) {
          values.put(element.getName(), element.getValue());
        }"Updating {} with {}", 
          feedable.getId(), values);
      if (!removeIds.isEmpty()) {"Removing {}", removeIds);
    return IndexerResult.persisted();
  public String getDocumentInfo(String s) throws IndexException {
    return null;

  1. Create a new source folder src/main/resources/META-INF/coremedia in the module.

  2. Create a Spring configuration file for the component named component-caefeeder-custom.xml in this folder

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
  <bean id="feederIndexer" class="com.customer.LogIndexer"/>
  1. In the file pom.xml of the CAE Feeder web application replace the dependency on caefeeder-solr-component with a dependency to your new component: caefeeder-custom-component.

  1. Add a corresponding logger to the logback configuration of the CAE Feeder application.

<logger name="com.customer" additivity="false" level="debug">
<appender-ref ref="file"/>

Search Results

Table Of Contents

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.