Enterprise Search in SharePoint 2013


As I have been increasingly working with Enterprise Search in SharePoint 2013, I have found myself continuously re-researching specific topics. Thus,¬†I have decided to publish this post and keep ot up to date with search content and configuration selfishly for my own reference, but if some else finds it useful – yayy! ūüôā

Search Schemahttp://technet.microsoft.com/en-us/library/jj219669.aspx
Large article encompassing search topics such as, crawled properties, managed properties, the seach index, and the variety of settings in search.

Search Relevancehttp://technet.microsoft.com/en-us/library/cc835623.aspx
Obviously a huge topic in SharePoint search. The above link is really just a reference point to several topics.

Search Architectural Diagramshttp://www.microsoft.com/en-ca/download/details.aspx?id=30374
PDF and VSD files containing the full search architeture in SharePoint 2013 Search.

Search Dictionaieshttp://office.microsoft.com/en-us/office365-sharepoint-online-enterprise-help/manage-search-dictionaries-HA103629159.aspx
Information regarding company names and spelling correction dictionaries.

Company Name Extractionhttp://technet.microsoft.com/en-us/library/jj591605.aspx
Functionality which allows administrators to provide SharePoint search with one or more company names. These can then be used as refiners to help narrow search results for users. Additionally this functionality supports both inclusion and exclusion lists.

Understanding Query Ruleshttp://office.microsoft.com/en-ca/sharepoint-server-help/understanding-query-rules-HA102848833.aspx
Pretty self-explanatory, but contains some high-level examples.

Changing the ranking of search results in SharePoint 2013http://blogs.technet.com/b/tothesharepoint/archive/2013/06/25/changing-the-ranking-of-search-results-in-sharepoint-2013.aspx

SharePoint 2013 Search Guidance –¬†http://planningservices.partners.extranet.microsoft.com/en/SDPS/SAPSDocuments/SharePoint%202013%20Search%20Guidance.docx

Building Search Queries in SharePoint 2013 –¬†http://msdn.microsoft.com/en-us/library/jj163973(v=office.15).aspx

I’ll keep updating this post as I find more useful information!

News on the Office Store Front: Subscription Apps!


This is really big news on the Office Store front, at least in my humble opinion, and straight from the Office News blog: http://blogs.office.com/b/office-news/archive/2013/10/01/office-store-investments-bring-new-opportunities-to-developers.aspx.

It reads as though we’ll be able to submitting updates to existing apps and submitting new apps for approval which leverage a subscription model sometime this month (October 2013). These apps will be available for purchase in the store starting in November! Looks like some of the supporting pricing model documentation has been updated too.

Now, I am personally a bit less concerned with Apps for Office and more concerned about Apps for SharePoint – naturally – but this is a big deal for both! What is the significance of the addition of this subscription pricing model? The answer is two-fold for me:

1) Constant revenue stream

This is a big problem I have had with the whole movement toward apps in general. For phones, tablets, you name it – anything you buy apps for. I know Apple addressed it a while ago – which was great – but for those of us taking a hard look at SharePoint 2013 app feasibility – how do you build a business focused app, sell it for a one-time fee, and support it forever? It’s not exactly a business model I’d be to ecstatic¬†to jump into.

There was the option of making the app free and building your own subscription model into it, but knowing sometime down the road that Microsoft was going to release this functionality to the store didn’t really drive me to dedicate resources to building one of my own.

2) Support / maintenance costs

This really goes hand-in-hand with the requirement of a constant revenue stream, but I like to highlight it due to the importance of it in planning an app. Typically a solid app is going to require some kind of back-end system or infrastructure  as well as people to support it. I know there are apps or services out there, such as some of the platform agnostic messaging apps, which are reliant on outside capital to support their infrastructure and development while the business grows. There is nothing wrong with the outside capital approach and it could very well be used to when developing subscription apps Рbut the subscription model provides that clear revenue path to support and maintain what is required for the app to function. It also makes the business model a bit more desirable if you do need capital.

Take a document conversion app for SharePoint Online as an example, the conversion itself needs to happen somewhere outside of SharePoint and someone needs to pay for that processing power. A subscription takes care of these costs. Don’t get me wrong, a large enough single purchase price could as well, but a small monthly cost is easier to sell than a large one-time cost.

There are many more reasons why this announcement is important to app developers and businesses, I for one am just happy the Office app subscription model is becoming a reality!

Useful SharePoint 2010 KB Articles


This will be a collection of articles or tools I find useful when it comes to potential deployment issues in a SharePoint 2010 environment. I’ll continually update it as I find new things!


  • SQL Database ‘<contentDBName>’ on SQL Server instance ‘<SQLServer>’ not found. Additional error information from SQL Server is included below. Cannot open database “<contentDBName>” requested by the login. The login failed. Login failed for user ‘<excelServicesAppProcessAccount>’.: http://support.microsoft.com/kb/981293

Controlling Database Growth in SharePoint 2007


One of the many problems when developing for SharePoint 2007 is database growth. This can be especially troublesome when your production environment has caching and auditing enabled. Here are some tricks to dealing with the growth.

  1. Disable Auditing when restoring your production environment in a development environment. This is highly important as the content database can very quickly grow far beyond the capacity of your development server. This does have to be done on a per site collection basis and can be found at _layouts/AuditSettings.aspx in each.
  2. Dump the tempdb. This is most easily achieved by restarting the offending SQL service in SQL Management Studio.
  3. Convert the offending database recover mode to Simple.
  4. Set up a detail maintenance plan and make sure that a Shrink Databases operation is in that plan.
  5. Trim the audit log. This is done with the trimauditlog stsadm command. An example for its use is “stsadm -o trimauditlog -date 20110930 -url http://locahost:8080” Depending on how out of control the growth is, you may have to run this in small date ranges and then restart SQL after to dump the tempdb (suggestion 2).
  6. Dump the eventcache history. This suggestion deals directly with the DB which is a no-no in the Microsoft SharePoint world, however this is a development server and if things go sideways a new restore is a very valid option. Here are some queries to help out:
  7. Use this to figure out which tables are the largest (in terns of number of rows):
  8. GO
    SELECT OBJECT_NAME(OBJECT_ID) TableName, st.row_count
    FROM sys.dm_db_partition_stats st
    WHERE index_id > 2
    ORDER BY st.row_count DESC
  9. Use this to figure out which event types in the eventcache table have the most occurrences:
  10. GO
    SELECT EventType, COUNT(*) as Total
    FROM [databasename].[dbo].[EventCache]
    GROUP BY EventType
  11. Use this to clear the offending event types from the eventcache table (source):
  12. GO
    While exists (SELECT TOP 1 * FROM eventcache where eventtype In(8192,8194,1048576) AND EventTime < DATEADD(day, -5, GETUTCDATE()))
    DELETE eventcache
    FROM (SELECT TOP 100000 * FROM eventcache where eventtype In(8192,8194,1048576) AND EventTime < DATEADD(day, -5, GETUTCDATE()) ) AS e1
    WHERE eventcache.id = e1.id
  13. Shrink the database files themselves. This can be done in SQL Management Stuido. Often it's best to set the space just slightly above the suggestion Management Studio gives you.
  14. Create a batch file that restarts the offending SQL service nightly. This will help manage the growth of your tempdb.

Hiding the ‘Category’ Text in a List View with a Group By


I recently had a request of me to hide the ‘Category:’ text on a List View web part in a MOSS 2007 farm.¬† As I have now had this request a few times and each time have to go figure out how to do it again, I thought that meant it was time for a quick blog post!¬† I found the original source here.¬† It’s a great write up, but there are a few enhancements mentioned in the comments that were never incorporated into the script code of the article.¬† So here is the code with the changes incorporated:

The site collection could not be restored…sufficient free space


Recently I came across the dreaded error below while restoring a production backup into a development / test environment using stsadm.exe -o restore.

“The site collection could not be restored. If this problem persists, please make¬†sure the content databases are available and have sufficient free space.”

First a bit of background on the backup package: it was a measly 1.34GB in total size.  Not even what I would consider to be medium when it comes to SharePoint site collections.  The target environment was 3 servers with one dedicated SQL server (running SQL Server 2008 R2), an app server and WFE (MOSS 2007 build  Database storage volume on the SQL server was 100GB with 80GB free.  I thought this should be plenty.

So, when I first ran across the above error I did the simple things:

  • Checked the hard disk space on the SQL server – all volumes
  • Verified that the target content database was available
  • Checked the hard disk space on the remainder of the farm servers

When none of those proved fruitful I did what all SharePoint folks do Рconsulted Google!  I found many interesting suggestions, some of which probably work(ed) in other situations, but failed for me:

  • I found stopping / restarting Windows SharePoint Services Timer service & iisreset here
  • The not-so-helpful KB926061 article
  • Monitoring various disks for growth during the restore from here and this prompted me to look into disk I/O which was ultimately the cause

After watching all my disks (on db, app, and wfe), I decided to start looking into disk I/O on the SQL box.  I noted that it was high, with an average disk queue length running around 70, I decided to flip on SQL profiler to watch for errors.   Low and behold: Error: 1222, Severity: 16, State: 18 РDatabase Deadlocks!!  And lots of them right before stsadm threw that dreaded error.

Solving the problem was a bit more tricky. ¬†My SQL server is virtualized – definitely not recommended for production, but this also wasn’t production with a quarterly user load of about 10. ¬†Very difficult to justify a physical box. ¬†So, I started shutting down services that would be accessing the DB server during the restore – in particular: search! ¬†After that and consolidating the mdb files (there were three because of how production is set up) I was able to complete a restore for the first time in months!

Now on to handing this environment to a db admin to do some performance tuning and to the virtual server team to see if we can find a faster disk for the database drive!

Using JQuery to "Hide" Empty Divs


So, I thought it was about time for me to start blogging again.  So much for weekly.  I will shoot for monthly this time!

Anyway, here’s today scenario:

I have a page layout with several fields (plain text or rich html) exposed.  The template is meant to be used for corporate policies which can be very long with many sections or very short with one section and anywhere in between.  What I needed to do was remove the &nbsp; from child divs that only contained that in the html.

With the use of some jquery and a bit of trial and error the code below will do exactly what I wanted.  When the page is rendered the empty lines are removed.  When the page is edited all the field controls are still shown accordingly.

$(document).ready(function() {
	$('.<divclassgoeshere>').each(function() {
		var value=$(this).children(":first").html().toLowerCase();
		if(value=='&nbsp; ') {