none
How to mark the fql query generated by the ESP Lookup operator with 'annotation_class="user"' RRS feed

  • Question

  • Hi,

    I have a created a Search View in Fast ESP 5.3sp3. Then, I have created an IMS Flows that use this Search View. Finally, I have created a website that calls that flow.

    Everything working fine except that the search queries made inside the website are not taken into account when FAST ESP is generating it's User's Queries Report. I have found in the FAST ESP documentation that only the queries marked with "annotation_class='user'" are taken into account.

    I have read the FSIS documentation but I could not find anything useful on how to mark a query with this annotation.

    So, my question is: how can I add the "annotation_class='user'" to the fql query generated by the ESP Lookup Operator?

    Thanks,

    Jean-Francois Charron

    Tuesday, October 5, 2010 8:23 PM

Answers

  • All,

    I got the answer from MSFT support on how to do this.  It can be done and is pretty easy to do so.  Below is the workaround I got back from support.

    The following example code will perform the necessary steps: The below code will always add the annotation_class parameter, even when adding navigators, so all statistics will be recorded and boost/block functionality will be available should you choose to use it.

     

               var fOnSearchRequestContextHandler = function(sender, e) {

     

                    var searchOperators = sender._search.get_searchOperator();

                    var searchFql = searchOperators._generateFQL();

                    var paramString = searchFql.substring(0, searchFql.indexOf(')')) + ", annotation_class=\"user\"" + searchFql.substring(searchFql.indexOf(')'), searchFql.length);

                    var addParam = new Ims.Search.AdditionalParameter("query", paramString, "ESPLookup");

                    sender._search.set_additionalParameters([addParam]);

                   

                    return e;

                };

               

                executor.add_searchRequestContextHandler(fOnSearchRequestContextHandler);

     

    Using the searchRequestContextHandler event ensures that the additional parameter will be updated when the query is modified (such as by adding a navigator filter).

    Thanks,

    Jeremy

    Monday, March 28, 2011 1:11 PM

All replies

  • Not sure if it's the best way, but you could add annotation_class='user' as a static parameter in SBC for the search view you are using.

    Regards,


    Search Enthusiast - MCTS SharePoint/WCF4/ASP.Net4
    http://techmikael.blogspot.com/ - http://www.comperio.no/
    Saturday, October 16, 2010 10:54 AM
  • you annotate you queries in your string queries against the composite field. E.g:

    content:string("hello world", mode="simpleany",annotation_class="user")


    http://www.comperiosearch.com/
    Monday, October 25, 2010 9:20 PM
  • Thank you for your response and sorry for the late response.

     

    I tried your solution and it does not seem to work.

    Tuesday, October 26, 2010 4:24 PM
  • That's the fql I want but I am not using fql directly. I use FSIS to query Fast ESP. So, how can you configure your EspLookup operator in an IMS flow to output this type of fql.
    Tuesday, October 26, 2010 4:27 PM
  • Has anyone solved this?  We are looking to do the same.  We have tried to add it as a static parameter in SBC, but that was not successful. Any other suggestions?
    Thursday, March 3, 2011 8:23 PM
  • Hi Jamalcom,

     

    This can not be added as a static parameter in the SBC, as for it scopes the whole query and is not a parameter like filter or something else

    One way (and maybe the easiest) is to put the parameter when you are submitting the query via your frontend or websurver, on the right place of course.

    Note also that you are able to use the logtransformer without using the SBC and that it is much more powerfull.

     

    Regards Lina

    Monday, March 7, 2011 3:01 PM
  • We have tried everything we can to get the annotation_class="user" on the query via the IMS UI Toolkit, but have been unsuccessful. I opened a case with support this morning to get this resolved.

    Lina, thanks for the headsup on using the reporting outside of SBC. I have already started looking at it, but we just wanted to get some reporting out and chose the SBC to do so until we have development time to build another reporting UI.

    Thanks, Jeremy

    Monday, March 7, 2011 3:09 PM
  • Hi, 

    You can solve this problem, but it will have to happen in the  IMS flow (outside of IMS UI Toolkit).   You will need to modify the context object before it is passed to EspLookup operator.

    Some background first.  All things IMS revolve around context object and if you understand how to create and manipulate context objects you'll resolve quite a few of your IMS problems.  In fact, you'll be able to execute your native FQL (assuming you've upgrading from ESP) without major changes. The context object is described in documentation to some extent, but it is best to learn it by fire (after reading the docs, of course!):

    - Install all examples that come with FSIS. This will include a bunch of web application + some flows.  Ensure that examples work.

    - Learn how to debug IMS flows.

    - Edit the flow that will talk to ESP. Put a breakpoint right before the instance of EspLookup operator.  Run a query.

    - Take a look at the debugger and copy the value of the context object into Notepad or something and then inspect the structure.

    Context object will have quite a few elements -- most of the self-explanatory -- but the most important one is additionalParameters.  This is a element that may contain any parameter that can be understood by ESP.   All you have to do is to create a new additional parameter "query" and set it to the FQL you want, e.g. string("query term", annotation_class="user").  This query will overwrite the query that was initially supplied.  Done!

    Here is a flow pattern that I'd recommend for IMS flows that talk to Esp:

     

    FlowInput --> ... --> ContextObjectModifier --> EspLookup --> ...

     

    In this case ContextObjectModifier is an instance of RunCode.  It is designed to do something to the context object, e.g. overwrite its "query" parameter with a new one as described above, add additional search parameters, etc.  Since context object is nothing more than XML, you can use native .Net libraries to create your manipulation code. 

    Of course, if you do not use IMS UI Toolkit, you can avoid the trouble with the flow. Create a the context object "by hand" and then add an additional parameter, query, with your FQL. 

    Best of luck,

    -Search Ninja (www.comperiosearch.com)

    P.S: Sorry, I don't have the actual code of the XML transformation. If you reach out to MSFT support, they should be able to give you an answer :)

    Wednesday, March 9, 2011 7:56 AM
  • All,

    I got the answer from MSFT support on how to do this.  It can be done and is pretty easy to do so.  Below is the workaround I got back from support.

    The following example code will perform the necessary steps: The below code will always add the annotation_class parameter, even when adding navigators, so all statistics will be recorded and boost/block functionality will be available should you choose to use it.

     

               var fOnSearchRequestContextHandler = function(sender, e) {

     

                    var searchOperators = sender._search.get_searchOperator();

                    var searchFql = searchOperators._generateFQL();

                    var paramString = searchFql.substring(0, searchFql.indexOf(')')) + ", annotation_class=\"user\"" + searchFql.substring(searchFql.indexOf(')'), searchFql.length);

                    var addParam = new Ims.Search.AdditionalParameter("query", paramString, "ESPLookup");

                    sender._search.set_additionalParameters([addParam]);

                   

                    return e;

                };

               

                executor.add_searchRequestContextHandler(fOnSearchRequestContextHandler);

     

    Using the searchRequestContextHandler event ensures that the additional parameter will be updated when the query is modified (such as by adding a navigator filter).

    Thanks,

    Jeremy

    Monday, March 28, 2011 1:11 PM
  • FSIS patch 02 was just released. Both IMS and IMS UI Toolkit now supports the annotation_class parameter out of the box.
    Marcus Johansson | Search Enthusiast | http://www.comperiosearch.com | http://www.linkedin.com/in/marcusjohansson
    Tuesday, August 30, 2011 1:43 PM