I had a little time this week and thought I’d write a quick stsadm extension to enumerate
and set
index ranking parameters, when querying MOSS indexes.

My main motivation was so you could change the ranking order of XLS files over PPT
files etc.

There seems to be a ancient art in setting these values.

So what’s included:

1. an XML file that needs to be copied to the \12\Config folder. Tells stsadm about
the new commands and what class to run.

2. A .NET assembly that needs to be GAC-ed so the stsadm doesn’t
have to look too hard to try and find the class.

Creating an extension is a pretty easy thing – extend an interface
as follows:

 

The next part was to interface with the indexing service as follows:

The keyValues collection are created by stsadm and passed
into your method –
how good is that.smile_regular

To get access to the Ranking and SearchContext classes
a few additional references are required. Such as:

– Microsoft.Office.Server
– Microsoft.Office.Server.Search
– Microsoft.Sharepoint.Search

These are all in the attached project.


Running the enumindexrankparams looks a little like this:
(these are some secret numbers to do with weightings of ‘click depth’, ‘url depth’,
language etc. A value of 0 is ignored. I’m still working through
what these exactly are – apart from the file type ones)

As I understand you can’t add additional weightings here for file types like PDF etc.

the commands to run this are:

1. stsadm -o enumindexrankparams -site <url to ssp>

2. stsadm -o setindexrankparams -site <url to ssp> -<rank name>
<rank value>
    stsadm -o setindexrankparams -site <url to ssp> -filetypepriorlistitems
1

Have fun – the project shows you how to extend the stsadm and also start to get a
bit of a feel of the Search/Index APIs.

Grab the source here –

Source
Code

>