none
Is it possible to sort the Auto suggestion keyword based on hit? RRS feed

  • Question

  • Hi,

     

    Just wonder that is it possible to sort the Auto suggestion keyword bases on previous hit?

    Let's say in the past few days, user searched "FAST" many times.

     

    Then, when user type "FAS" in the search box, I would like to see "FAST" keyword on top. And other "FAST ... " keyword below.

    Is it possible?

     

    Best Regards,

    Andy

    Wednesday, January 18, 2012 10:55 AM

Answers

  • Hi Andy,

    Basically what you do is instead of calling the GetQuerySuggestions webmethod, you call your own method which again calls GetQuerySuggestions on search.asmx. This way you can examine whatever is returned and execute your own code before returning the results.

    You're not intercepting the actual search results, only the query suggestions which comes from a database and not from FS4SP. My sample uses this to security trim the suggestions, checking that you actually get hits for each suggestions before returning it (at the expense of hitting the search engine with multiple queries that is).

    Regards,
    Mikael Svenson 


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    • Marked as answer by Andy_Chan Tuesday, January 24, 2012 5:01 PM
    Thursday, January 19, 2012 7:54 PM

All replies

  • Andy,

    It sounds like you are talking about updating internal query suggestions list not based on "search + click", i.e click-through, but pure search hits.

    One thing i can think of doing is as follows.  With custom query suggestions, they are either captured automatically via click-through(based on default number of clicks) or preparing a file with a list of your own query suggestions and loading it up via PowerShell:

     

    http://blogs.msdn.com/b/guruketepalli/archive/2011/05/03/fast-2010-query-completion-lifecycle-an-insight.aspx

     

    If you could figure what specific hits you want as part of your custom query suggestions, then it's easy to make the changes and have that "previous hits" functionality.  The trick would be figuring out previous hits, you could probably do this by scraping FAST querylogs for previous query text or by looking at SQL Server db's. 

    Maybe there are better ways of doing this....

     

     


    Igor Veytskin
    Wednesday, January 18, 2012 12:36 PM
    Moderator
  • Hi Andy,

    With some custom coding this is possible. You can override the search box webpart, redirct it to your own webservice, where you intercept the suggestions and sort based on a custom list per user. (You would store this list by overriding the core results web part and store the query per user).

    In the upcoming book on FS4SP which I'm an author on I have a sample on how to intercept the query suggestions which could easily be modified for your purpose *shameless PR :)*

    Regards,
    Mikael Svenson 


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    Thursday, January 19, 2012 11:53 AM
  • Hi Mikael,

     

    Congratulation for the book!!!

    I think it will be a good reference :).

     

    Come back to the topic, the solution you suggested is to used the share object in the SharePoint, right? (etc, override the search box web part). But I want to know that is it possible to intercept the suggestion from the web service? (i.e. query packet). Because I implemented the custom search page and I interact with FAST through the web service.

     

    For example, can we intercept the suggestion from your FAST Search TOOL (MOSSMAN)?

    Best Regards,

    Andy

     

    Thursday, January 19, 2012 6:07 PM
  • Hi Andy,

    Basically what you do is instead of calling the GetQuerySuggestions webmethod, you call your own method which again calls GetQuerySuggestions on search.asmx. This way you can examine whatever is returned and execute your own code before returning the results.

    You're not intercepting the actual search results, only the query suggestions which comes from a database and not from FS4SP. My sample uses this to security trim the suggestions, checking that you actually get hits for each suggestions before returning it (at the expense of hitting the search engine with multiple queries that is).

    Regards,
    Mikael Svenson 


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    http://techmikael.blogspot.com/
    • Marked as answer by Andy_Chan Tuesday, January 24, 2012 5:01 PM
    Thursday, January 19, 2012 7:54 PM