<rankingModel name=”string” id=”GUID” description=”string” xmlns=”http://schemas.microsoft.com/office/2009/rankingModel“>
<queryDependentFeatures>
<queryDependentFeature pid=”PID” name=”string” weight=”weightValue” lengthNormalization=”lengthNormalizationSetting” />
</queryDependentFeatures>
<queryIndependentFeatures>
<categoryFeature pid=”PID” default=”defaultValue” name=”string”>
<category value=”categoryValue” name=”string” weight=”weightValue” />
</categoryFeature>
<languageFeature pid=”PID” name=”string” default=”defaultValue” weight=”weightValue” />
<queryIndependentFeature pid=”PID” name=”string” default=”defaultValue” weight=”weightValue”>
<transformRational k=”value” />
<transformInvRational k=”value” />
<transformLinear max=”maxValue” />
</queryIndependentFeature>
</queryIndependentFeatures>
</rankingModel>
Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchMetadataManagedProperty
Well, let's go on with the queryIndependentFeatures. categoryFeature I guess is about Categories contained in the Metadata Property Mapping’s. I’m not interested in it, so I skip it. To weight different language with LanguageFeature does not interest me either, because everything is in Swedish.
<?xml version="1.0" encoding="utf-8"?>
<rankingModel name="KM_Ranking" id="0f054f54-6a42-4a9b-abcb-123456778" description=”KMs viktning på managed property” xmlns=”http://schemas.microsoft.com/office/2009/rankingModel“>
<queryDependentFeatures>
<queryDependentFeature pid=”56" name=”Filename” weight=”75" lengthNormalization=”75” />
<queryDependentFeature pid=”11" name=”Land” weight=”70" lengthNormalization=”70"/>
<queryDependentFeature pid=”2" name=”Län” weight=”70" lengthNormalization=”70"/>
<queryDependentFeature pid=”3" name=”Kommun” weight=”60" lengthNormalization=”60"/>
<queryDependentFeature pid=”4" name=”Stad” weight=”55" lengthNormalization=”55"/>
<queryDependentFeature pid=”5" name=”Stadsdel” weight=”50" lengthNormalization=”50" />
<queryDependentFeature pid=”6" name=”Församling” weight=”45" lengthNormalization=”45"/>
<queryDependentFeature pid=”7" name=”Postnummer” weight=”40"lengthNormalization=”40"/>
<queryDependentFeature pid=”8" name=”Created” weight=”30¿ lengthNormalization=”30"/>
<queryDependentFeature pid=”1" name=”Body” weight=”20" lengthNormalization=”20" />
</queryDependentFeatures>
<queryIndependentFeatures>
<queryIndependentFeature name=”DocumentPopularity”
pid=”306" default=”0" weight=”80">
<transformRational k=”1.2170868558"/>
</queryIndependentFeature>
</queryIndependentFeatures>
</rankingModel>
Get-SPEnterpriseSearchServiceApplication | New-SPEnterpriseSearchRankingModel
When I run the script, I will be prompted to write the XML. Organize the XML into one line and past it into the PowerShell command window.
$rankingModel = Get-SPEnterpriseSearchServiceApplication -Identity “Search Service” | Get-SPEnterpriseSearchRankingModel $rankingModel | Remove-SPEnterpriseSearchRankingModel
Show installed ranking models:
Get-SPEnterpriseSearchServiceApplication -identity “Search Service Application Name” | get-SPEnterpriseSearchRankingModel
SELECT TOP 1000 [ModelId]
,[IsDefault]
,[ModelXml]
FROM [Servernamn_Search_AdminDB].[dbo].[MSSRankingModels]
<property name=”DefaultRankingModelID” type=”string”>0f054f54-6a42-4a9b-abcb-1234567</property>
I save the file and go to the search results page. I choose Edit –> Insert –> web part -> “Upload a Web part” and transfer my core results web part.
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (1)
Author
Commented: