Posts

Showing posts from September, 2015

SharePoint 2013 ​ zero width spacing characters.

Hi, Just want to let you know that to clean SharePoint html from the Rich Text Editor that has all annoying &#8203 characters, it is better to use this lovely script . Using standard jquery such as: jQuery('#s4-bodyContainer').html(jQuery('#s4-bodyContainer').html() .replace(/\u200B/g,'') ); can lead to unintended behaviour in certain scenarios, especially when some of the content is generated asynchronously as that script will replace the html before it's generated. This happened to me when I used the Search Result Webpart . HTH, Andreas

SharePoint 2013 contentclass STS_ListItem_850 not working anymore - no search results returned

Hi all, We just noticed in our lower environments after patching to SP1 + May 2015 CU, that our search returns no result. We have a Result Source with this filter: contentclass=STS_ListItem_850 and that is the culprit. Removing that filter returns all results. So I'm curious what the actual value is returned. Lucky we can check quickly with Search REST api. Running: http://mysite.com/_api/search/query?Querytext='page'&RowLimit='10'&SelectProperties='Title, ListID, contentclass' I see that the value is now So I changed STS_ListItem_850 to STS_ListItem_PublishingPages and now it works correctly again. HTH, Andreas

SharePoint 2013 How to exclude specific pages from search results

Hi all, Just want to share you a tip on how to exclude certain pages from your search results. e.g. test or obsolete pages that have been published but you want it to be hidden. The answer is to use a query rule. 1. Go to Site Settings -> Search Query Rules 2. Select the Result Source that you use, and add New Query Rule 3. Give it a name, and Remove Condition so the rule applies to all queries 4. click Change ranked results by changing the query. Again choose the appropriate source and here you can add filter on the properties. in my case I use the page Title: {searchTerms} -Title:"my page test" -Title:"Obsolete page to be hidden" 5. You can then test your queries for immediate change. Your changes will appear after a few seconds as SharePoint has suggested. HTH, Andreas