Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Removing custom result type

$
0
0

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.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>