10

I have a custom ranking model which works great. But is it possible to give some page layouts higher ranking than others?

I started trying this with file types as a lot of the examples are using that. But it is not working.

The rankingmodel.xml I use looks like this:

<?xml version="1.0" encoding="utf-8"?><rankingModel
name="CustomRankingModel"
id="302A9E0E-F8B9-4b21-8180-C327ECCBBA94"
description="Custom Ranking Model"
xmlns="http://schemas.microsoft.com/office/2009/rankingModel">
  <queryDependentFeatures>
    <queryDependentFeature name="Body" pid="1" weight="13" lengthNormalization="0.5"/>
    <queryDependentFeature name="Title" pid="2" weight="20" lengthNormalization="0.5"/>
    <queryDependentFeature name="Author" pid="3" weight="8" lengthNormalization="0.5"/>
    <queryDependentFeature name="Description" pid="6" weight="5" lengthNormalization="0.5"/>
    <queryDependentFeature name="FileExtension" pid="319" weight="10" lengthNormalization="0.5"/>
    <queryDependentFeature name="MetaInformatie" pid="403" weight="11" lengthNormalization="0.5"/>
    <queryDependentFeature name="Filename" pid="56" weight="10" lengthNormalization="0.5" />
    <queryDependentFeature name="FileType" pid="98" weight="10" lengthNormalization="0.5" />
  </queryDependentFeatures>
  <queryIndependentFeatures>
    <categoryFeature name="FileType" pid="98" default="0">
      <category name="Aspx" value="0" weight="0" />
      <category name="Docx" value="1" weight="30" />
      <category name="Pdf" value="2" weight="100" />
    </categoryFeature>
  </queryIndependentFeatures>
</rankingModel>

I tried in the xml above to show .pdf on top and hide or display .aspx files below. But I can't seem to give them the right name/value/weight.

Again in the end I want to use it on the content type of the page layout (if it is even possible) but for now I wish I could understand how to modify the file type weights.

1

I haven't worked with custom ranking since FAST ESP so apologies in advance if I'm not much help.

Sounds like you narrowed it down to name/value/rank for FileType. Here are a few thoughts:

  1. Have you confirmed your FileType values match what's in your instance?
  2. Is value OK to begin with 0? (An example in the book referenced below starts with 1.)
  3. Are your category elements listed in correct order? Maybe order highest to lowest by value. (I doubt this is it but SharePoint Search can be very finicky. See page 412 of Pro SharePoint 2010 Search by Noble, Piddoke, Bakmand-Mikalski)
  4. Is your Search Web Part set to use the new ranking model? (Since you already have a custom ranking model that works, I suspect this isn't it either, but we all miss a detail eventually. This post provides details.)
  5. Are you troubleshooting with the SharePoint 2013 Search Query Tool?

To confirm your FileType values match those in the system, try the below SP commands, gleaned from blogspot

$ssa = Get-SPEnterpriseSearchServiceApplication
Get-SPEnterpriseSearchFileFormat -SearchApplication $ssa | ft –AutoSize

I hope this helps. Please let me know.

  • tnx for the answer but i do not have the files/site anymore so i can not answer your questions. :( – Youri Jun 2 '16 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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