5

Right now we are using SDL Tridion 5.3 soon we will be upgrading to Tridion 2011 SP1. While upgrading to Tridion 2011 SP1 we also want to use FAST FISE (SP 4) search engine for implementing search on the published web site.

Can anyone help us in understanding how this can be done with respect to Deployer extentions as well as changes in Content Delivery side (we have .NET implementation). Is there any API reference or implementation documentation available?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
user1453602
  • 1,165
  • 5
  • 14

1 Answers1

9

I don't have specific experience with FAST, but can't be different from many other search engines as far as integrating works.

The easy way: - Do nothing, let FAST crawl your site and gather all information it needs. This is the most cost-effective way of doing search integrations, and many people forget that at the end of the day this usually covers ~98% of their requirements.

The real-time way: Write a Deployer module that notifies FAST every time something is (un)published so the indices can be updated (see at the end for a sample module that can probably get you started).

The over-engineered way: Write a JPA-compliant Storage extension for Tridion: http://www.sdltridionworld.com/articles/sdltridion2011/tutorials/extending-content-delivery-storage-sdltridion-2011-1.aspx

Sample code for a deployer extension:

import java.util.Iterator;

import com.tridion.configuration.Configuration;
import com.tridion.configuration.ConfigurationException;
import com.tridion.deployer.Module;
import com.tridion.deployer.ProcessingException;
import com.tridion.deployer.Processor;

import com.tridion.transport.transportpackage.Binary;
import com.tridion.transport.transportpackage.BinaryKey;
import com.tridion.transport.transportpackage.Component;
import com.tridion.transport.transportpackage.ComponentKey;
import com.tridion.transport.transportpackage.MetaData;
import com.tridion.transport.transportpackage.MetaDataFile;
import com.tridion.transport.transportpackage.Page;
import com.tridion.transport.transportpackage.PageKey;
import com.tridion.transport.transportpackage.ProcessorInstructions;
import com.tridion.transport.transportpackage.Section;
import com.tridion.transport.transportpackage.TransportPackage;

import org.slf4j.LoggerFactory;
import org.slf4j.Logger;


public class CustomCacheNotificationDeploy extends Module {

    String action = null;
    Logger log = null;
    MetaDataFile pageMeta = null;
    MetaDataFile componentMeta = null;
    MetaDataFile binaryMeta = null;
    public CustomCacheNotificationDeploy(Configuration config, Processor processor)
            throws ConfigurationException {
        super(config, processor);
        log = LoggerFactory.getLogger(getClass());
        // TODO Auto-generated constructor stub
    }

    @SuppressWarnings("deprecation")
    public void process(TransportPackage data) throws ProcessingException{
        ProcessorInstructions instructions = data.getProcessorInstructions();
        action = instructions.getAction();
        MetaData pageMetaInfo = instructions.getMetaData("Pages");
        MetaData componentMetaInfo = instructions.getMetaData("Components");
        MetaData binaryMetaInfo = instructions.getMetaData("Binaries");
        pageMeta = data.getMetaData("Pages", pageMetaInfo.getName());
        componentMeta = data.getMetaData("Components", componentMetaInfo.getName());
        binaryMeta = data.getMetaData("Binaries", binaryMetaInfo.getName());

        log.debug("Action " + action + " started for publication " + instructions.getPublicationId());

        Section section = null;
        Iterator<Section> Sections = instructions.getSections();
        for(; Sections.hasNext(); processSection(section))
        {
            section = Sections.next();
        }

    }

    protected void processSection(Section section)
    {
        log.debug("Processing Section " + section.getName());
        Iterator iterator = section.getFileItems();
        Object item;
        for(; iterator.hasNext(); processItem(item, section))
        {
            item = iterator.next();
        }
        Section subSection;
        for(Iterator i$ = section.getSubSections().iterator(); i$.hasNext(); processSection(subSection))
            subSection = (Section)i$.next();
    }

    protected void processItem(Object obj, Section section)
    {
        if(obj instanceof PageKey)
        {
            log.debug("Object is Page");
            PageKey key = (PageKey) obj;
            Page page = (Page)pageMeta.getMetaData(key);
            log.debug("Page being deployed is " + page.getId() + " with URL " + page.getURLPath());
        }
        if(obj instanceof ComponentKey)
        {
            log.debug("Object is Component");
            ComponentKey key = (ComponentKey) obj;
            Component component = (Component)componentMeta.getMetaData(key);
            log.debug("Component being deployed is " + component.getId());
        }
        if(obj instanceof BinaryKey)
        {
            log.debug("Object is Binary");
            BinaryKey key = (BinaryKey) obj;
            Binary binary = (Binary)binaryMeta.getMetaData(key);
            log.debug("Binary being deployed is " + binary.getId() + " with URL " + binary.getURLPath());
        }
    }
}
Nuno Linhares
  • 10,214
  • 1
  • 22
  • 42
  • Thanks Nuno for quick reply. We will be using deployer extention, so while publishing page, component, binary content we will be pushing metadata content/content to FAST. At Content delivery side we want to use some FAST APIs those will be fetching content from FAST collection(database or filesystem). I don't have any hands on experience on FAST implementation. – user1453602 Jun 13 '12 at 15:51
  • @Nuno fresher in tridion. so could you please explain how to use this code ? what are the steps to be followed to use deployer extension? i've created the pages. now want to provide search functionality in pages. a textbox with a search button should provide this functionality.like this web site has at top extreme right. – AmateurCoder Jun 17 '12 at 05:33
  • 2
    Strongest piece of advice ever - first find out how to do it without Tridion. Then move it to be part of your template output. Seriously, forget Tridion and try it out first. This deployer extension is just an example of how you can run code during deployment, has nothing to do with search or search functionality. – Nuno Linhares Jun 17 '12 at 15:17
  • Java is the only way to implement deployer extensions or we can do it using C#.Net as well? – user1453602 Sep 18 '12 at 16:21
  • Only Java. If you are allergic to it, consider implementing your functionality via a WebService (with .NET) and just creating a simple client for it from the Java side. – Nuno Linhares Sep 18 '12 at 16:38
  • Page is deprecated, any replacement for it in, i am struggling to find the alternative to it. – Techmaster Apr 23 '13 at 12:46