Mittwoch, 27. Juli 2011

Bring up crawled contend to the user (map indexed contend to a managed property)

In one of my last post I wrote about extracting data via xpath out of the “hithighlightedsummary” field (LINK) - here I want to show another method to make contend that is in the search index usable for user experience.
I just want to use the same SQL Table as in my previous posts. Also I want to bring up the field “ApkBezeichnung1” (which is called “Task” in the BCS SharePoint List based on this SQL table in the previous post) to the front
 So the underlying and crawled data locks like this:

Now let’s use some PowerShell calls to see what the search server, in my case the FAST search server knows about this contend source. The crawled contend / crawled properties are normally sorted in so called Metadata Categories. This PowerShell call shows all existing Metadata Categories on your server:
Get-FASTSearchMetadataCategory
As result we get something like that:

We see that there is a category called “Business Data” witch contains all crawled Data coming from any BCS source
Next we want to do is showing all crawled properties in the Metadata Category “Business Data
Therefore we use this call:
Get-FASTSearchMetadataCrawledproperty |ForEach-Object{ if ($_.CategoryName -eq "Business Data") {$_.Name} }

Another way to find out details of the crawled contend / crawled property we want to bring to the front is this call:
Get-FASTSearchMetadataCrawledProperty -filter apkbezeichnung1
“apkbezeichnung1” is name of the field in the SQL table.
The –filter parameter does not support wildcards. Matching is case-insensitive, and matches a string anywhere within the name attribute of the crawled property:

So we now know that the field is crawled and that the name of the crawled property is “read listelement.apkbezeichnung1”.
To use the property in SharePoint Search we have to map the property to an existing managed property or create a new managed property. I will create a new one with these calls:

1.       $v1 = New-FASTSearchMetadataManagedProperty –Name "BCSTask” –type 1

2.       Set-FASTSearchMetadataManagedProperty –Name “BCSTask” –Queryable $true –
StemmingEnabled $false –RefinementEnabled  $false

3.       $v2 = Get-FASTSearchMetadataCrawledProperty -filter apkbezeichnung1

4.       New-FASTSearchMetadataCrawledPropertyMapping –Managedproperty $v1 –crawledproperty $v2

The result is:

We now have a managed property. It can be used in SharePoint Search after the next crawl of the contend source. The managed property contains contend from the database column “ApkBezeichnung1”.
Examples:
Now we can do something like this and use the new managed property “BCSTask” direct in the search box: search term: “BCSTask:Dongel”

1 Kommentar:

  1. The crawled contend / crawled properties are normally sorted in so called metadata categories. This powershell call shows all existing metadata categories on your server.
    https://www.idealsvdr.com/

    AntwortenLöschen