One less publicized change in the April 2013 CU for SharePoint 2013 is the ability to change the maximum number of characters indexed of a given file. By default, SharePoint indexes 512 KB of the body of a document. Anything after that isn’t include as it doesn’t deem it relevant. This can be changed now with a simple PowerShell script. Before, we do this, you should know that this default value is mentioned in the Software Boundaries and Limits document. A page that anyone that administers SharePoint should be quite familiar with. This basically states, the more you index, the more disk space you consume and the more load you place on your system. Therefore, I encourage you to test this out thoroughly before turning on your production farm of multiple TB of content. Assuming, you have tested everything and you are good to go, let me show you what you need to do.
Create a simple script file and add the following commands. This first command gets a reference to the body managed property. You need to specify the name of your Search Service Application which most people tend to name Search Service Application.
$mp = Get-SPEnterpriseSearchMetadataManagedProperty -Identity body -SearchApplication "Search Service Application"
On the next line you specify the number of characters to index in bytes. By default, that means this value is 524288. In my example, we’ll increase it to 1 MB, so we’ll use a value of 1048576
$mp.MaxCharactersInPropertyStoreIndex = "1048576"
Now, the next line commits the changes to the managed property.
$mp | Set-SPEnterpriseSearchMetadataManagedProperty
Finally, you can see the value you set with, the last command.
Once you run this script, you should simply see the value you set at the command line.
If you get an error such as the following, that means you do not have the April 2013 CU or later. You’ll need to apply this CU if you want this functionality. Be aware, it can take a long time to apply this CU.
Exception setting "MaxCharactersInPropertyStoreIndex": "The managed property "body" can't have MaxCharactersInPropertyStoreIndex set to 1048576: The value must be in the range from 0 to 450."
If you didn’t get any errors, you now need to perform a full crawl as expected. You should then have more content in your index. This can be tricky to test because you’ll have to go into files and find content that wasn’t previously in the index, but now it is. Good luck!