我想知道如何从coveo搜索的索引中删除sitecore项目字段。我知道,通过coveo.searchprovider.config,这是可能的
https://developers.coveo.com/display/public/SitecoreV3/Customizing+the+Indexing+Parametersenter link description here
<exclude hint="list:AddExcludedField">
<fieldId>{8CDC337E-A112-42FB-BBB4-4143751E123F}</fieldId>
</exclude> 但我希望在字段级别创建属性,该属性将指示从索引中排除,并使用我要从coveo索引中排除属性复选框。
会不会是解释博客https://developers.coveo.com/display/public/SitecoreV3/Excluding+Sitecore+Items+From+Your+Index的流水线?
发布于 2017-08-22 20:42:48
是的,入站筛选器就是您要找的。
public class ApplyCoveoInboundIndexShouldBeExcludedFieldFilter : AbstractCoveoInboundFilterProcessor
{
public override void Process(CoveoInboundFilterPipelineArgs args)
{
if (args.IndexableToIndex != null && !args.IsExcluded && ShouldExecute(args)) {
if (ItemShouldBeExcluded(args.IndexableToIndex.Item)) {
args.IsExcluded = true;
}
}
}
private bool ItemShouldBeExcluded(IItem item) {
return item.GetFieldValue("SHOULD_INDEX_ITEM_FIELD_NAME") == "0";
}
}根据需要修改ItemShouldBeExcluded方法。
https://stackoverflow.com/questions/45811969
复制相似问题