Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to make Managed Property for a taxonomy term without creating a corresponding site column. I want to make my MMS terms and termsets and having corresponding refined Managed Property and corresponding Crawled Property, without creating a taxonomy field on the site. (I want to use it in REST API Search query). thanks.

share|improve this question
add comment

1 Answer 1

You can use PowerShell to create a Crawled property and a managed property.

You can use the following code to create and map the properties

Param(
 [string]$crawledProp,
 [string]$managedProp,
 [int] $typeManagedProp
)

# TypemanagedProp 1 = Text 2 = Integer 3 = Decimal 4 = DateTime 5 = YesNo 6 = Binary 7 = Double
$snapin = "Microsoft.SharePoint.PowerShell"

if ((Get-PSSnapin -Name $snapin -ErrorAction SilentlyContinue) -eq $null)
{
    Write-Host -ForegroundColor Green "PSsnapin $snapin is registered"
    Add-PsSnapin $snapin
    Write-Host -ForegroundColor Green "PSsnapin $snapin is loaded"
}

$searchapp = Get-SPEnterpriseSearchServiceApplication

$category = Get-SPEnterpriseSearchMetadataCategory –SearchApplication $searchapp –Identity SharePoint

$crawlpropTemplate = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp -Category $category –Limit 1 

$cProp = Get-SPEnterpriseSearchMetadataCrawledProperty -Name $crawledProp -Category $crawlpropTemplate.CategoryName -SearchApplication $searchapp 

if ($cProp -eq $null)
{ 
    Write-Host -ForegroundColor Yellow "Creating CrawledProperty '$crawledProp' " -NoNewline
    $cProp =  New-SPEnterpriseSearchMetadataCrawledProperty -Name $crawledProp -VariantType $crawlpropTemplate.VariantType -Category $crawlpropTemplate.CategoryName -PropSet $crawlpropTemplate.PropSet -SearchApplication $searchapp  -IsNameEnum $false 
    Write-Host -ForegroundColor Green " - Done."
}

$mProp = Get-SPEnterpriseSearchMetadataManagedProperty -Identity $managedProp -SearchApplication $searchapp  -ErrorAction SilentlyContinue
if ($mProp -eq $null)
{
    Write-Host -ForegroundColor Yellow "Creating ManagedProperty '$managedProp' " -NoNewline
    $mProp = New-SPEnterpriseSearchMetadataManagedProperty -Name $managedProp -Type $typeManagedProp -SearchApplication $searchapp -ErrorAction:SilentlyContinue 
    $mProp.Refinable = $true
    $mProp.Update()
    Write-Host -ForegroundColor Green " - Done."
}


if( $mProp -eq $null -or $cProp -eq $null)
{
    Write-Host -ForegroundColor Red "Mapping not created "    
    if( $mProp -eq $null)
    {
        Write-Host -ForegroundColor Red " - ManagedProperty is Null"
    }
    if( $cProp -eq $null)
    {
        Write-Host -ForegroundColor Red " - CrawledProperty is Null"
    }
}
else
{
    $mapping = Get-SPEnterpriseSearchMetadataMapping -ManagedProperty $mProp -CrawledProperty $cProp -SearchApplication $searchapp

    if( $mapping -eq $null)
    {
        Write-Host -ForegroundColor Yellow "Creating mapping between '$crawledProp' and '$managedProp' " -NoNewline
        $mapping = New-SPEnterpriseSearchMetadataMapping -ManagedProperty $mProp -CrawledProperty $cProp -SearchApplication $searchapp  
        Write-Host -ForegroundColor Green " - Done."
    }    
}

Write-Host " "
share|improve this answer
    
thank you. I enabled a TermSet for Faceted Navigation, When I go to Terms to add a Managed Property and click Customize Refiners it generates following error: No suggested refiners are displayed, because no refiner values are found in the data tagged with this term. have any idea why? –  Medes Apr 25 '13 at 9:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.