Sitecore管道(indexing.filterIndex.inbound)未被调用

时间:2017-11-10 16:30:22

标签: lucene sitecore

我正在尝试在Sitecore 8.x中创建一个对未经身份验证的用户(extranet \ Anonymous)可见的项目的Lucene索引。为此,我尝试使用indexing.filterIndex.inbound管道。

我尝试编写一个自定义管道,如果该项无法读取为外网,则返回false \ Anonymous:

    public class ApplyInboundIndexAccessFilter : InboundIndexFilterProcessor
{
    public override void Process(InboundIndexFilterArgs args)
    {
        var item = args.IndexableToIndex as SitecoreIndexableItem;
        var anonymousUser = Sitecore.Security.Accounts.User.FromName("extranet\\anonymous", false);

        if (!item.Item.Security.CanRead(anonymousUser))
        {
            args.IsExcluded = true;
        }
    }
}

但是这个管道决不会被调用。

我已经添加了我的配置(尝试使用默认设置,之前,之后,默认删除)

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <pipelines>
            <indexing.filterIndex.inbound>
                <processor type="MyApplication.Site.Features.ContentSearch.IndexFilters.ApplyInboundIndexAccessFilter, MyApplication.Site">
                    <includedIndexNames hint="list">
                        <indexName>siteSearchIndex_web</indexName>
                    </includedIndexNames>
                    <excludedIndexNames hint="list">
                        <indexName>siteSearchIndex_master</indexName>
                    </excludedIndexNames>
                </processor>
            </indexing.filterIndex.inbound>
        </pipelines>
    </sitecore>
</configuration>

我是否正确地假设这应该在索引时调用,如果没有,何时?

我们将非常感激地收到任何建议。

0 个答案:

没有答案