5

现在我们正在使用 SDL Tridion 5.3,很快我们将升级到 Tridion 2011 SP1。在升级到 Tridion 2011 SP1 的同时,我们还希望使用 FAST FISE (SP 4) 搜索引擎在已发布的网站上实现搜索。

任何人都可以帮助我们了解如何在 Deployer 扩展以及内容交付方面的变化(我们有 .NET 实现)方面做到这一点。是否有任何 API 参考或实现文档可用?

4

1 回答 1

9

我没有 FAST 的具体经验,但就集成作品而言,与许多其他搜索引擎没有什么不同。

最简单的方法: - 什么都不做,让 FAST 抓取您的网站并收集它需要的所有信息。这是进行搜索集成的最具成本效益的方式,许多人忘记了在一天结束时这通常可以满足他们约 98% 的需求。

实时方式:编写一个 Deployer 模块,该模块在每次(未)发布某些内容时通知 FAST,以便可以更新索引(请参阅末尾的示例模块,该模块可能可以帮助您入门)。

过度设计的方式:为 Tridion 编写符合 JPA 的存储扩展:http ://www.sdltridionworld.com/articles/sdltridion2011/tutorials/extending-content-delivery-storage-sdltridion-2011-1.aspx

部署程序扩展的示例代码:

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());
        }
    }
}
于 2012-06-13T12:52:02.727 回答