Overview

Last year, I published a blog about OpenSearch on SCN. Today, I would like to extend this blog with a few advanced topics and some new functionality that has been developed.

Apart from the general Document Search described in the previous blog, OpenSearch can now also be used to access some special cases of search like Faceted Search, Best Bets and Sponsored Content. These will be the focus here.

Faceted Search

Faceted Search gives you a distribution of results by attributes.

It is used, for example, in the Filter Section of the search UI (left panel), as you can see in: http://search.sap.com/ui/#query=hana&startindex=1


Now, it’s also possible to access this functionality via OpenSearch. Let’s see how.

Let’s assume you want to know how many results exist for “hana tutorial” in each of the different SAP sites (attribute “scm_a_site”) and for each kind of document (attribute “scm_a_resourcetype”). In this case, you can request:

http://search.sap.com/opensearch?query=hana+tutorial&searchtype=fc&facet=scm_a_site&facet=scm_a_resourcetype

and get as result something like:

facetedSearch.png

This shows you that, of the total number of results, 445 come from help.sap.com, 147 from SCN and 4 from sap.com (distribution by Site). In a similar way, 433 are of type Help Documentation, 64 of type Discussion Forum and 42 of type Tutorial (distribution by Asset Type).

As you’ve seen, 2 parameters are necessary:

  • searchtype = “fc” to indicate you want to execute a facet search
  • facet = name of attribute for which you want the distributions. Can be used multiple times, if you require distributions for several attributes.

Additionally, you can use the optional parameter below to limit the number of distributions returned. This is useful, when one of the attributes used as facet has a high number of possible values (ex. scm_a_author) and you want to minimize the performance impact. In this case, you may not want to get distributions for all the values in the first request.

  • limit = maximum number of distributions per attribute

You can also combine some of the existing OpenSearch functionality like Filters and Authentication with faceted search. However, other functionality like Sorting or Paging doesn’t make sense with this kind of search.

Although most attributes can be used as facet, there are some exceptions. For example, attributes of type TEXT (ex. scm_a_keywords, scm_a_title and scm_a_description) are not supported as facets. Also attributes, which have not been configured to be used as facets, may not work.

Finally, you should know that HTML format is not supported for faceted search and that the RSS format is the default one. Both RSS and ATOM formats have been extended to support facet search. Below you can see the extensions added. 

  • facetId = id of the attribute used as facet

       Example:

       <sap_it:facetId>scm_a_site</sap_it:facetId>

  • facetLabel = label of the attribute used as facet

        Example:

        <sap_it:facetLabel>Source</sap_it:facetLabel>

  • facetValue = one of the possible values of the attribute used as facet. Contains information about the attribute value (id and label) and the number of results with this value.

        Example:

        <sap_it:facetValue>

               <sap_it:id>scm_v_Site10</sap_it:id>

               <sap_it:label>Help.sap.com</sap_it:label>

               <sap_it:count>50</sap_it:count>

        </sap_it:facetValue>

Best Bets

Best Bets is a special category of results designed to provide a user with the best possible results for some of the most common search terms.

They are created manually by Search Administrators based on reporting and massive analysis of all executed searches and displayed in a separate section of the search UI on top of the normal results.

This category of results is available both for internal and external search platforms, although its usage is more widespread in the internal platform (SAP only), where end users can also require their creation.

You can now also access these results via OpenSearch. For example, you can retrieve the Best Bets associated with the term “glossary” via the request:

http://search.sap.com/opensearch?query=glossary&searchtype=bb

As you can see, the following URL parameter and value are used for this purpose:

  • searchtype = “bb” to indicate you want to execute a search for Best Bets.

To restrict the results returned when “searchtype” “bb” is used, you can use the “filter” parameter to include a site filter as indicated in the second example below. Otherwise, only results marked as “Generic” will be returned.

For example, to retrieve the best bets associated with the term “hana” on the SCN site, you can request:

http://search.sap.com/opensearch?query=hana&searchtype=bb&filter=scm_a_site%28value%3Dscm_v_Site11%2Foperator%3DEQ%29

Sponsored Content

Sponsored content is also a special category of results, but unlike Best Bets it is created on request from end users and content owners, who wish to promote their content via search. In a way, similar to the sponsored links on Google.

Like Best Bets these resources are maintained manually by a Search Administrator and displayed in a separate section of the search UI (right panel). 

This kind of results is available both for the internal and external search platforms, but its usage is also more widespread in the internal platform, where employees and internal stakeholders can make their own requests online.

OpenSearch now also provides an interface to access these results. For example, you can the retrieve the sponsored links associated with the term “hana”, via the request:

http://search.sap.com/opensearch?query=hana&searchtype=sc

As you can see, the following URL parameter and value is provided for this purpose:

  • searchtype = “sc” to indicate you want to execute a search for Sponsored Content.

In the example above, you obtain the so-called Generic Sponsored Content (i.e. platform independent). However, you can also indicate that you’re interested only in links specific to a particular platform. For example, Sponsored Content for “hana” in the SCN platform:

http://search.sap.com/opensearch?query=hana&searchtype=sc&platform=scn

As you see, there is an additional parameter for this purpose:

  • platform = platform to which the search should be restricted. It only works in conjunction with searchtype “sc” and if not specified, then only results marked as “Generic” will be returned. Possible values are: “scn”, “cp”, “sme”, “http://help.sap.com” and “http://www.sdn.sap.com

Future Developments

OpenSearch will continue to evolve and step by step provide access to all different kinds of results and functionality available on the search platform.

We currently have requests to provide an interface to the “suggestions” functionality, as well as a better support for authentication.

We’ll keep you posted!

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply