FAST Search Server 2010 for SharePoint (FAST Search for SharePoint) is an alternative to the out-of-box SharePoint Server search (the built-in enterprise search solution in SharePoint Server 2010). If you want to understand the differences between SharePoint Server search and FAST Search for SharePoint, see How FAST Search for SharePoint fits into SharePoint 2010. One of the nice capabilities is a flexible item processing architecture, which also includes XML processing.
The simplest way to test a search index is to crawl a bunch of items from your SharePoint site. If you want to test various capabilities of your search deployment, it may be useful with a set of synthetic items with well-defined content and metadata. The advantage is that you can specify all properties of the indexed items. If you want to test ranking features, it is often simpler to use small, synthetic items. Using XML is a convenient way to create synthetic items.
You can use the XMLMapper custom processing stage to input XML documents. In this example we create a configuration to handle synthetic items with the following crawled properties (and the corresponding managed property mappings):
The following steps configure the item processing pipeline. For more information, see Customizing item processing (MSDN). Unless otherwise specified, you should apply the commands in a PowerShell window on the FAST Search for SharePoint administration server.
$cat = New-FASTSearchMetadataCategory -Name xmlprops -Propset $guid
Set-FASTSearchMetadataCategory -Category $cat -MapToContents 1
$guid Note the GUID value. This is a unique value that you need to add in the XMLMapper configuration file.
<processor name="XMLMapper" active="yes" /> <processor name="FFDDumper" active="yes" />
<XMLPropertiesCreator> <propset><GUID as created above></propset> <type>31</type> <XMLMappings> <Mapping attr="mytitle" path="//Title"/> <Mapping attr="mybody" path="//Body"/> <Mapping attr="mysize" path="//Size" type="3"/> <Mapping attr="mydate" path="//Date" type="64"/> <Mapping attr="mytags" path="//Tags"/> <Mapping attr="myint1" path="//Int1" type="3"/> <Mapping attr="myint2" path="//Int2" type="3"/> <Mapping attr="myint3" path="//Int3" type="3"/> <Mapping attr="myint4" path="//Int4" type="3"/> <Mapping attr="mytext1" path="//Text1"/> <Mapping attr="mytext2" path="//Text2"/> <Mapping attr="mytext3" path="//Text3"/> <Mapping attr="mytext4" path="//Text4"/> </XMLMappings> </XMLPropertiesCreator> For more information, see XML mapper schema (MSDN) .
<Document> <Title>Document 1</Title> <Date>2011-01-01T08:00:00Z</Date> <Size>128</Size> <Body>This is the first test document. alpha bravo charlie delta echo foxtrot golf hotel.</Body> <Tags> <Tag>alpha</Tag> <Tag>bravo</Tag> <Tag>charlie</Tag> </Tags> <Int1>1</Int1> <Int2>2</Int2> <Int3>3</Int3> <Int4>4</Int4> <Text1>alpha</Text1> <Text2>alpha bravo</Text2> <Text3>alpha bravo charlie</Text3> <Text4>alpha bravo charlie delta</Text4> </Document>
<Document>
<Title>Document 1</Title>
<Date>2011-01-01T08:00:00Z</Date>
<Size>128</Size>
<Body>This is the first test document. alpha bravo charlie delta echo foxtrot golf hotel.</Body>
<Tags>
<Tag>alpha</Tag>
<Tag>bravo</Tag>
<Tag>charlie</Tag>
</Tags>
<Int1>1</Int1>
<Int2>2</Int2>
<Int3>3</Int3>
<Int4>4</Int4>
<Text1>alpha</Text1>
<Text2>alpha bravo</Text2>
<Text3>alpha bravo charlie</Text3>
<Text4>alpha bravo charlie delta</Text4>
</Document>
docpush -c sp -u file:/// C:\XMLMapper\doc1.xml
By submitting the initial test document you have created the necessary crawled properties. Now you need to create the custom managed properties and set up the mapping to managed properties.
$mp = Get-FASTSearchMetadataManagedProperty -Name body $cp = Get-FASTSearchMetadataCrawledProperty -Name mybody New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp $mp = Get-FASTSearchMetadataManagedProperty -Name Title $cp = Get-FASTSearchMetadataCrawledProperty -Name mytitle New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp $mp = Get-FASTSearchMetadataManagedProperty -Name Size $cp = Get-FASTSearchMetadataCrawledProperty -Name mysize New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp $mp = Get-FASTSearchMetadataManagedProperty -Name Write $cp = Get-FASTSearchMetadataCrawledProperty -Name mydate New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp
$mp = New-FASTSearchMetadataManagedProperty -Name mytext1 -Type 1 $cp = Get-FASTSearchMetadataCrawledProperty -Name mytext1 New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp Set-FASTSearchMetadataManagedProperty -ManagedProperty $mp -SortableType 1 Set-FASTSearchMetadataManagedProperty -ManagedProperty $mp -RefinementEnabled 1 $mp = New-FASTSearchMetadataManagedProperty -Name mytext2 -Type 1 $cp = Get-FASTSearchMetadataCrawledProperty -Name mytext2 New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp $mp = New-FASTSearchMetadataManagedProperty -Name mytext3 -Type 1 $cp = Get-FASTSearchMetadataCrawledProperty -Name mytext3 New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp $mp = New-FASTSearchMetadataManagedProperty -Name mytext4 -Type 1 $cp = Get-FASTSearchMetadataCrawledProperty -Name mytext4 New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp $mp = New-FASTSearchMetadataManagedProperty -Name myint1 -Type 2 $cp = Get-FASTSearchMetadataCrawledProperty -Name myint1 New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp Set-FASTSearchMetadataManagedProperty -ManagedProperty $mp -SortableType 1 Set-FASTSearchMetadataManagedProperty -ManagedProperty $mp -RefinementEnabled 1 $mp = New-FASTSearchMetadataManagedProperty -Name myint2 -Type 2 $cp = Get-FASTSearchMetadataCrawledProperty -Name myint2 New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp $mp = New-FASTSearchMetadataManagedProperty -Name myint3 -Type 2 $cp = Get-FASTSearchMetadataCrawledProperty -Name myint3 New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp $mp = New-FASTSearchMetadataManagedProperty -Name myint4 -Type 2 $cp = Get-FASTSearchMetadataCrawledProperty -Name myint4 New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp
Richard Mueller edited Revision 13. Comment: Removed (en-US) from title, added tag
Craig Lussier edited Revision 12. Comment: added en-US to tags and title
Hi,
So great article and very helpful. Have you done a scenerio to index one single XML document with multple document nodes? The ESP Filetraverser will parse this out when we give them XPath which we do not have here. Thoughts?
Thanks.
Unfortunately you cannot submit multiple items in one XML file, as in FAST ESP.