Since the Pipeline Extensibility is not restricted to any content source and the fact that you do not have a proper API, makes it really hard to work with a specific Content Source.
Luckily for us we have a Crawled
property which is mapped to the managed property “ContentSource
”:
<CrawledProperty propertySet="012357BD-1113-171D-1F25-292BB0B0B0B0" varType="31" propertyName="315" />
So you can include this in your extensibility configuration and you can see which content source the data came from and apply appropriate logic.
Example:
static void Main(string[] args)
{
XDocument inputDoc = XDocument.Load(args[0]);
XElement outputElement = new XElement("Document");
string contentSourceName = GetContentSource(inputDoc);
if (contentSourceName == "My Content Source")
{
}
outputElement.Save(args[1]);
}
private static string GetContentSource(XDocument inputDoc)
{
var res = from cp in inputDoc.Descendants("CrawledProperty")
where new Guid(cp.Attribute("PropertySet").Value).Equals(
new Guid("012357BD-1113-171D-1F25-292BB0B0B0B0")) &&
cp.Attribute("PropertyID").Value == "315"
select cp.Value;
return res.First();
}
This way we managed to apply our own logic for a specific Content Source.
Reference:
I would like to thank Jorge Einbund, a talented .NET developer for helping me with this post.
Hope you’ll find this post helpful.