Hi,
I added a new result type "PDF for Preview" in result type for previewing the PDF files in search result, using the following power shell command.
$tenantOwner = Get-SPEnterpriseSearchOwner -Level SSA $ssa = "Search Service Application" #adjust if you renamed the service application $rule = get-SPEnterpriseSearchPropertyRule -PropertyName "FileType" -Operator "IsEqual" $rule.AddValue( "pdf" ) $ruleCollection = Get-SPEnterpriseSearchPropertyRuleCollection $ruleCollection.Add($rule) $item = new-SPEnterpriseSearchResultItemType -Owner $tenantOwner -SearchApplication $ssa -Name "PDF with Preview" -Rules $ruleCollection -RulePriority 1 -DisplayProperties "Title,Author,Size,Path,Description,EditorOWSUSER,LastModifiedTime,CollapsingStatus,DocId,HitHighlightedSummary,HitHighlightedProperties,FileExtension,ViewsLifeTime,P arentLink,ViewsRecent,FileType,IsContainer,SecondaryFileExtension,DisplayAuthor,docaclmeta,ServerRedirectedURL,SectionNames,SectionIndexes,ServerRedirectedEmbedURL,S erverRedirectedPreviewURL" -DisplayTemplateUrl "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Word.js" -OptimizeForFrequentUse $true
Unfortunately, it didn't work for me and now i am unable to open the word documents in the browser. I tried to remove the result type using following command but no success:
$tenantOwner = Get-SPEnterpriseSearchOwner -Level SSA $ssa = "Search Service Application" $item=Remove-SPEnterpriseSearchResultItemType -Identity "PDF with Preview" -Owner $tenantOwner -SearchApplication $ssa
Somebody mentioned in another forum to get the index of the result type to remove it. Can any body tell me how to get the index property and how to remove it from result types.
Any help would be really appreciated.