Basic Search tips

Search within a SharePoint can be a bit of
a challenge as I found out the last few days, so I decided to make a nice overview
about what you can do with ‘search’ and what can’t do (with some nice examples). So
in a small series of what you can do this is the first, with some basic info about
the search and its properties.

According to this MSDN article
there are 3 values that can be passed in the URL to the search results webpart, in
order to define your resultset. The first property: K, which should contain your searched
value (it says you can only use one value for this property). Next is the V, that
can be filled either with relevance or with date, and determines the sorting of the
results. And the final value is start, which contains the starting page of the results.

Here it looks like the MSDN article is a bit
out dated, since most of you knows the S property for the Scope.  So
actually there are four properties (that I know of):

Property

Description

K

Specifies
the searched value

V

Specifies
the sorting of the result set

Start

Specifies
the starting page

S

Specifies
the scope in which will be searched


 

Luckily for us the K query string allows us
to actually do a lot more than just passing the searched keyword. It also allows the
use of and + for
excluding or including additional terms.

Property

Description


Excludes
a term

+

Includes
a term


 

Not only does the K property allows you to
pass search words, it also allows you to use MetaDataPropperties, (that will be discusses
in the next post).

The sorting of a result set  is
something where SharePoint lacks the properties you want it to have, you can’t sort
on date / name, so you actually have to find yourself a nice hack (that will be discussed
in the 3th post).

The starting page is something I have never
used before, that part is completely handled by your paging control.

The Scope property however is something that
you will learn to love, it allows you to create scopes, and those will help you create
a better result set. For instance you have a list where you store all your orders,
and you want to search that. Scopes allow you to specify the result set. Not only
by location but with ANY!  MetaDataPropperty
that has it enabled.

So the next post will be all about MetaDataPropperties,
that will allow you to search not only the common used properties, but everything
you want. (it will also explain how you can use custom properties in your search results).


 

Leave a Reply