xm_tools
dev
  • Overview
  • Configuration
  • Tools
    • Session handling
    • Query
    • Paging
    • Filter-List-Flow
    • I10n
    • Parameters
    • Caching
    • Extension manager
    • Services
    • REST-API Connector
    • ErrorHandler and ProductionExceptionHandler
    • Extensions
      • ke_search
    • More tools
  • ViewHelper
  • Templates
xm_tools
  • Docs »
  • Tools »
  • Extensions »
  • ke_search
  • Edit on GitHub

ke_searchΒΆ

To ease the use of Custom indexers for the search extension ke_search, xm_tools offers two components:

  • Tha value object IndexEntry class for new index entries.
  • The AbstractIndexer, which your custom indexer may extend to care for registering the indexer and storing IndexEntry objects.

Usage example:

class BlogIndexer extends AbstractDWIDBIndexer
{
    const TYPE = 'blog';

    public function customIndexer(&$indexerConfig, &$indexerObject)
    {
        $content = '';

        if ($indexerConfig['type'] == self::TYPE) {

            $repository = $objectManager->get('\Xima\BlogExampleExtension\Domain\Repository\BlogRepository');
            $blogs = $repository->findAll();

            foreach ($blogs as $blog)
            {
                $indexEntry = new IndexEntry();
                $indexEntry->setTitle($blog->getTitle());
                $indexEntry->setAdditionalFields(...);
                // add more entry data

                parent::storeInIndex($indexEntry, $indexerObject, $indexerConfig);
            }

            $content = parent::getReport($indexerConfig, $blogs);
        }

        return $content;
    }

    protected function getType()
    {
        return self::TYPE;
    }

    protected function getName()
    {
        return 'BlogIndexer';
    }
}
Next Previous

© Copyright 2014-2016 Sebastian Gierth, Steve Lenz, Wolfram Eberius. Revision 2b642fdd.

Built with Sphinx using a theme provided by Read the Docs.