Wednesday, August 15, 2012

SharePoint 2010 Search

good course on Search :

http://msdn.microsoft.com/en-us/sp2010devtrainingcourse_extendingsharepointsearchlab_topic2

Scott Hillier speak on the search in SP 2010 is being noted below and I am a fan of this persons speaking

Managed Property

We create a managed property 'Avg Rating' and map it one to one with the crawled property OSS-AvgRating.
The Managed Property is kind of the HumanReadable property that u would like to map with the crawled property that is
fetched and indexed from the 3rd party data source.

Imp : A crawler crawls and fetches data from any ext sources in a raw form . Say crawled database gets info regarding geographies .Some call their geography USA,Some America,others come from Asia ,others from japan .
All of these can be grouped into one term called 'address' which can be in the managed database.So its a mapping from the crawled db to the managed db. 

Relevancy

When/while searching we have to increase relevancy
Ranking and Sorting :
Relevancy  is like a spice in the meal. u are nudging the item to be more relevant and then it will appear in the
search


Authoratative pages :

SSA and u can tell certain pages to be  authoritative page.So the docs will spear at the top
****** -- dint understand much

Custom Ranking models : new in SP 2010
Query independent element : no matter what the user type s (say) xml/doc elements are pushed to the top .
Q dependant element  : depending on the keyword that was typed.it rises to the top.

You have to enable the SpEnterprise SeachManagedproperty is explicitly use the managed property in the ranking model.
The next step is to create the ranking model which is nothing but an xml file as shown in the below screen shot . 

Here the 'body' is give '0' weight  in the query independent feature
BUt the q dependent feature is given the weight which is required here .
PID is the property id of the managed property that u care about.U can get the same using PowerShell

XML for Ranking Model





AFTER THATS DONE WE WILL HAVE to display the same using the searchCore Results webPart.SP has 6-7 OOB ranking models.There is a default ranking model that can be setup for this WEbP.The rest of the  6 of them are people search.We can get a list of SharePoint ranking models. Also we get the id related to each of those models .

CoreSearchResults Webp uses XSLT for the same .Value of the avg rating columns and    
Export the  webpart.Open the same and search for the 'DefaultrankingModel Property'change the value from and empty string to the GUID models that pwershell was used for installation, a few minutes back.

Search CR Webpart

Combination of PowerShell commands

Some results from the search :
suppose u type in
a* AverageRating>0

The search return the results after going through the ranking model and the index associated with the same.

Suppose u type in
AverageRating>0
Then the search only goes through the managed property database and not thru the ranking model/index etc.Its faster.
Reason : There is no value typed in  before the 'AverageRating' .Hence the search doesnt go deep .


Customizing Search center


In SP 2010 we can get involved in the search pipeline before the query is executed(before its fed into the search) and even after the query has been run(display of results using the XSLT).

All 'Site Content' , we can get the searachresults tab and the Searchtab. When we  edit the same we can see that they are tied to diff aspx pages .ie, Search Results.aspx and Search.aspx






The key new thing in SP 2010  is that we can inherit from the CorResultsWebpart and create a webpart based on the same.Inside the same we can create the object of the Query manager class and then create a query for the same.QM object allows u to insert/manipulate the pipeline before the query is executed.
Here in the picture is the 'Assigned To' managed property that we are targeting.




.Net asembly connector =  BCS model
It exposes the External system to crawling .
We can create custom connectors

BCS Allows    u to search external system.So in this example we search a external doc system for searching something . its external to SP so we will use BCS for the same .The solution here is that we  have the option of searching a doc and being able to open the doc.
We create an ECT -- is like a regular content type(doc/task CT).It represented fields from the external system and the operations that we can perform on that external doc system.So BCS creates an service class that is used to read the data that we want to.

No comments:

Post a Comment