Microsoft announced this week in its blog some news brought by the April update for Office 365. What’s New in the Office 365 April Update Outlook Client Manager. Aimed at small businesses, it becomes easier to deal with customers without having to leave Outlook. Outlook Customer Manager is available to Office 365 Business Premium subscribers and can be accessed through Read more…
Since SharePoint 2013, SharePoint Search features are a lot more powerful than in previous versions. The information discovery potential is enormous, we can connect to external sources (SQL, Web Services, etc) drastically improving the potential of any solution using Search. But sometimes the configuration necessary to connect with external content sources can be painfull (BCS, External Content Types, etc). In Read more…
It’s been a while that we’ve been developing SharePoint Provider Hosted apps and one of the problems that happens most of the time is that you need update the app for SharePoint and add the new lists without lose any data from others existing lists. Basically, if you publish one SharePoint Provider hosted app with a set of customs lists, and Read more…
We all have had our share of pain when it comes to using High Trust Add-ins in SharePoint. The aim of this article is to put together a collection of common problems and solutions. I’ll try to keep this post updated with any new issues that we might come across. Error – 401 unauthorized error when running a high-trust app Read more…
Recently while trying out the new SharePoint Framework in conjunction with the Sp-PnP-Js-Core library we came across a small difficulty dealing with the Promises while accessing the SharePoint API. Our intent was to develop a simple web part to manage lists on SharePoint using the Sp-PnP-Js library as way of comunication with the Sharepoint. For the most part it was Read more…
Microsoft released a test version of To-Do, a task list application for Android, iOS and Windows yesterday, Wednesday (19th April). It was developed by the same creators of Wunderlist, purchased by Microsoft in 2015, and will replace the older brother in the future. To-Do has an interface reminiscent of Wunderlist. You can create multiple lists, set up reminders for each Read more…
Office365 Roadmap A cool thing that not many people knows, is how the Office365 is dealing with requests from Community. There is actually a Roadmap that everyone that keep up with and lists updates that are currently planned for applicable subscribers. Updates are at various stages from being in development to rolling-out to customers to being generally available for applicable customers Read more…
There are situations where you might need to create new tabs and buttons on the ribbon and all you have to work with is javascript. If you ever find yourself in such a situation here is a small example of javascript code to create new button and a new tab: ExecuteOrDelayUntilScriptLoaded(function () { //Wait for sp.ribbon.js to be loaded var Read more…
In one of our projects we had an interesting challenge, how could we preview documents stored on an SQL Database using Office Web Apps (like we see in SharePoint). To accomplish that we created a Wopi Host and in this blog post we will briefly explain how a Wopi Host works and how it allowed us to preview documents using Read more…
Recently we came across the need to manipulate the values of Managed Properties. In our specific case it was required that for some contents, the File Type Managed Property should be empty.
In order to do so we used the Content Enrichment web service, which is a service that adds a custom step to content processing in order to enable users to modify managed properties values before they are indexed.
In this blog post we’ll walk you through the steps we took in order to configure the service and also talk about some of it’s limitations and how we can overcome them.
Creating the Web Service
The web service consists of a basic WCF that receives an array of managed properties and outputs an array of managed properties that are customized according to our needs. In our scenario we just needed to clean the FileType managed property of some contents, so our output will be an array containing just the FileType managed property with an empty value. Let’s begin:
Create a WCF Service Application (ex: SLEnrichmentService)
Add a reference to the Microsoft.Office.Server.Search.ContentProcessingEnrichment.dll (located in Installation Path\Microsoft Office Servers\15.0\Search\Applications\External\)
Modify the service to implement IContentProcessingEnrichmentService the contract interface as following:
public class SLEnrichmentService : IContentProcessingEnrichmentService
{
private const string FileTypeManagedProperty = "FileType";
private const int UnexpectedType = 1;
private const int UnexpectedError = 2;
private readonly ProcessedItem processedItemHolder = new ProcessedItem
{
ItemProperties = new List<AbstractProperty>()
};
public ProcessedItem ProcessItem(Item item)
{
processedItemHolder.ErrorCode = 0;
processedItemHolder.ItemProperties.Clear();
try
{
var fileTypeProperty = item.ItemProperties.Find(x =>
x.Name.Equals(FileTypeManagedProperty,
StringComparison.InvariantCultureIgnoreCase))
as Property<string>;
fileTypeProperty.Value = null;
processedItemHolder.ItemProperties.Add(fileTypeProperty);
return processedItemHolder;
}
catch (Exception)
{
processedItemHolder.ErrorCode = UnexpectedError;
}
return processedItemHolder;
}
}
Publish your service
Configure SharePoint
Publishing it is not enough, In order for the Search Service to call our service we first need to register it. To do that we need to run a simple Powershell in which we say where the Web Service is located, which Managed Properties it expects and what managed properties it will return. In this specific case we just need to clean the FileType property, so this will be both our input and output property.
Since we just need the service to be called for some types of content, in our powershell we’ll have a trigger condition that validates that condition. In this scenario we have a custom Managed Property called SLExtChannel that holds the values of the types of contents, we will use it to check if the service should be called or not.
Here is our powershell:
$ssa = Get-SPEnterpriseSearchServiceApplication
$config = New-SPEnterpriseSearchContentEnrichmentConfiguration
$config.Endpoint = "https://searchsql.sp2013cm.local/Service/SLEnrichmentService.svc"
$config.InputProperties = "FileType"
$config.OutputProperties = "FileType"
$config.SendRawData = $false
$config.Timeout = 30000
$config.Trigger = "!(IsNull(SLExtChannel))
AND ((SLExtChannel==""SLNewsContentType"")
OR (SLExtChannel==""PurchaseOrder"")
OR (SLExtChannel==""SLFAQContentType"")
OR (SLExtChannel==""ProcessedReport"")
OR (SLExtChannel==""2"") OR (SLExtChannel==""3"")
OR (SLExtChannel==""4"") OR (SLExtChannel==""5"")
OR (SLExtChannel==""7"") OR (SLExtChannel==""11"")
OR (SLExtChannel==""12""))"
$config
Set-SPEnterpriseSearchContentEnrichmentConfiguration –SearchApplication $ssa –ContentEnrichmentConfiguration $config
After running the script all you need to do is perform a Crawl.
Conclusions
Although this was a simple example we can see how useful this web service can be, we can address issues like missing/inconsistent metadata, clean content, merge data from other services, etc.
By using the trigger condition we can ensure that the service will be called only when that condition is verified minimizing the impact on the Crawl/Index.
Nonetheless there are still some drawbacks when it comes to using this service:
The content enrichment web service is a synchronous callout in the content processing pipeline, complex operations may impact the crawl durations/performance.
We can have only one Content enrichment service registered per Search Service Application, which means that all content sources will be enable to use the Content Enrichment Service.
If we want to have specific callouts for each Content Source we can still achieve that by registering a WCF Routing Service as our Content Enrichment Web Service and create a route table based on the content source performing the callout.