none
Synonym search is not working after extending the search core result web part with enable FQL RRS feed

  • Question

  • Hi,

    I have to admit that this should be the expected behavior. I extended the Search Core Result webparts and enable the "EnableFQL" option. and I modified the FQL before send to FAST Search.

    Then, I perform search, but the synonym search is not working.

    I suspected that it's because I enabled the FQL and modified FQL in the webpart.

     

    Can someone  confirm me that enabled the FQL is really the root cause?

    And if it did, do we have other workaround in the case that we have modified the FQL and want the synonym search works.

     

    Thanks and Regards,

    Andy


    • Edited by Andy_Chan Monday, July 11, 2011 9:17 AM type
    Monday, July 11, 2011 8:25 AM

Answers

  • Hello Andy,

    yes it is the cause. I'm planning on releasing a fql enabled core result webpart on codeplex this week, with proper synonym support. I just have to nail down all my kql parsing first.

    Regards,
    Mikael Svenson 


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    • Proposed as answer by Mikael SvensonMVP Friday, July 15, 2011 7:52 PM
    • Marked as answer by Andy_Chan Monday, July 18, 2011 6:45 AM
    Monday, July 11, 2011 12:36 PM
  • Here's the beginning of the code to access the synonyms:

    var ssaProxy = (SearchServiceApplicationProxy)SearchServiceApplicationProxy.GetProxy(SPServiceContext.Current);
    if (ssaProxy.FASTAdminProxy != null)
    {
    	var fastProxy = ssaProxy.FASTAdminProxy;
    	KeywordContext keywordContext = fastProxy.KeywordContext;
    	SearchSettingGroupCollection searchSettingGroupCollection = keywordContext.SearchSettingGroups;
    	foreach (SearchSettingGroup searchSettingGroup in searchSettingGroupCollection)
    	{
    		foreach (Keyword keyword in searchSettingGroup.Keywords)
    		{
    			foreach (Synonym synonym in keyword.Synonyms)
    
    Regards,
    Mikael Svenson


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    • Marked as answer by Andy_Chan Monday, July 18, 2011 6:45 AM
    Friday, July 15, 2011 7:51 PM

All replies

  • Hello Andy,

    yes it is the cause. I'm planning on releasing a fql enabled core result webpart on codeplex this week, with proper synonym support. I just have to nail down all my kql parsing first.

    Regards,
    Mikael Svenson 


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    • Proposed as answer by Mikael SvensonMVP Friday, July 15, 2011 7:52 PM
    • Marked as answer by Andy_Chan Monday, July 18, 2011 6:45 AM
    Monday, July 11, 2011 12:36 PM
  • Hi Mikael,

     

    Could you please let me know how can you enable synonym support when enable the FQL?

    Is it just enable the flag? Or

    you have to get the keyword synonym from the Manange keyword List and then add in the FQL?

     

    Thanks for your support.

    Best Regards,

    Andy

    Monday, July 11, 2011 3:44 PM
  • Hi Andy,

    Basically you need to pull in the synonym list from FAST Keyword Management, parse the user query, and build a new custom fql including the synonyms yourself. Writing the kql->fql parser is what takes the most time.

    You have to support queries like:

    ALL(word1 word2) ANY(word1 word2) NONE(word1 word2)

    "exact phrase"

    property:"some value"

    word1 OR word2

    word1 AND word2

    and ranges.

    And any combination of these :) While writing my unit tests on the operators and comparing with what FS4SP is translating kql->fql, I actually discovered it has a few minor bugs in their internal parser when you combine many of the above operators.

    -m


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    Monday, July 11, 2011 7:19 PM
  • Hi Mikael,

     

    Yes, I totally agree. Parsing from KQL -> FQL is the hardest part because there are many combinations and format.

     

    But I still wonder that how can you access the synonym list. Is it something like this?

     

                       FASTSearchRuntime runtime = value as FASTSearchRuntime;

                        string listUrl = [The Manage Keywords List];
                        SPList list = web.GetList(listUrl);
                        SPQuery oQuery = new SPQuery();
                        oQuery.Query =
                            "<Where>" +
                            "   <Eq>" +
                            "       <FieldRef Name='Keywords'/>" +
                            "           <Value Type='Text'>" +  runtime.Location.MappedQueryTemplateUrl + "</Value>" +
                            "   </Eq>" +
                            "</Where>";
                        SPListItemCollection collListItems = list.GetItems(oQuery);

     

    I just wonder that what is the listUrl for the Manage Keywords List.

    Do you have any ideas?

    Best Regards,

    Andy

    Tuesday, July 12, 2011 6:50 AM
  • Here's the beginning of the code to access the synonyms:

    var ssaProxy = (SearchServiceApplicationProxy)SearchServiceApplicationProxy.GetProxy(SPServiceContext.Current);
    if (ssaProxy.FASTAdminProxy != null)
    {
    	var fastProxy = ssaProxy.FASTAdminProxy;
    	KeywordContext keywordContext = fastProxy.KeywordContext;
    	SearchSettingGroupCollection searchSettingGroupCollection = keywordContext.SearchSettingGroups;
    	foreach (SearchSettingGroup searchSettingGroup in searchSettingGroupCollection)
    	{
    		foreach (Keyword keyword in searchSettingGroup.Keywords)
    		{
    			foreach (Synonym synonym in keyword.Synonyms)
    
    Regards,
    Mikael Svenson


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    • Marked as answer by Andy_Chan Monday, July 18, 2011 6:45 AM
    Friday, July 15, 2011 7:51 PM
  • Thanks Mikael.

     

    One more question... Have you already released the FQL webpart that you mentioned before?

    If you did, could you please give me the codeplex link?

    Thanks and Regards,

    Andy

    Monday, July 18, 2011 6:44 AM
  • The url is http://spsearchparts.codeplex.com/, but the project is not yet published. Expect a few more days for the alpha version to be available. I'm on holiday so I can't code that much every day :)

    -m


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    Monday, July 18, 2011 8:39 PM
  • I will keep visit.... Many Thanks

    Andy

    Tuesday, July 19, 2011 8:54 AM
  • It's live in alpha version -  http://spsearchparts.codeplex.com/

    -m


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    Tuesday, July 19, 2011 8:58 PM