Thursday, January 12, 2012

Extend Search Core Result Web part with FAST for SharePoint 2010

I have tried to extend Search Core Result Web part with simple customization and deployed as feature to FAST SharePoint 2010 Template as following:

[ToolboxItemAttribute(false)]
    public class AppendCoreResultWebPart : CoreResultsWebPart
    {
protected override void ConfigureDataSourceProperties()
        {
        //Just Append Search Query with My Name
            this.AppendedQuery = "Fadi Abdulwahab";

            base.ConfigureDataSourceProperties();
        }
    }
}



But the problem in this web part that did not show any result by default but the rest controls like paging or Refinement web parts returned results as the below image

 So to fix this problem as Mr. Mikael Svenson [I asked him to help me in this issue] said just "Export the settings from the default core results webpart.. And add those to the .webpart file of your custom webpart"
Note: I advice you to visit  Mr. Mikael Svenson  blog  http://techmikael.blogspot.com/ 
So just go to Web Parts page under Site Actions >> Site Settings >> Galleries and export the .webpart file of Default Search Core Result web part and then copy the below properties and then export your custom web part file and add the below properties and then upload it again to web part galleries

        <property name="ChromeType">None</property>
        <property name="AllowMinimize" type="bool">true</property>
        <property name="AllowClose" type="bool">true</property>
        <property name="Hidden" type="bool">false</property>
        <property name="ShowActionLinks" type="bool">false</property>
        <property name="ShowMessages" type="bool">true</property>

Finally Go to SharePoint page and remove the old web part and add the new web part J.


1 comment:

Mikael Svenson said...

Thanks for nailing down the exact properties needed as I hadn't had the time to do this :D