This page provides an overview of the Fredhopper Query API. We advise you to review it in detail before following the step-by-step tutorial of setting up your front-end application.
Query API components
The Fredhopper Query API connects Fredhopper with your front end application and allows you to create Fredhopper functionalities in your presentation layer. The Query API supports SOAP and REST, and is defined by the WSDL for SOAP and by the XSD for REST/XML and the Fredhopper Query Language. The key elements in the schema are further described in the paragraphs below.
| Only use the SOAP or REST interfaces for integration. Do not use preview pages XML view for this, as this does not scale and is not supported. |
Query serializer/de-serializer
The Query serialiser/de-serialiser consists of the classes that convert between exchange format sent via the network and the objects used in the application code. Fredhopper supports automated serialization/de-serialization via SOAP and manual serialization/de-serialization via REST/XML:
- The SOAP integration allows you to communicate with Fredhopper over a standard SOAP/WSDL interface that is supported by all common programming languages like Java, .NET and PHP. SOAP is the preferred integration approach given its excellent abstraction and cheap maintenance.
- In a REST/XML integration the front-end application sends queries via HTTP and gets an XML document as return. In most aspects it is identical to a SOAP integration, with the notable exception that the query de/serialization needs to be manually created and maintained. Also, with REST/XML the page views have to be triggered explicitly (index.jsp, search.jsp, detail.jsp). This guide does not discuss the creation of the query de/serialization layer.
| The SOAP interface is a wrapper around the REST/XML interface. Therefore the content of both interfaces is identical. The SOAP API has a minor overhead of ~10ms per request assuming there is enough memory available (SOAP requires ca. 10% more memory than REST/XML). Query post-processing (WebService extensions) is only available for the SOAP integration. |
Query Language Library
Query Language library comprises a software library for Java and .NET that helps to build and to manipulate the Fredhopper Query Language.
The Fredhopper Query Language defines which content Fredhopper returns will deliver for a given query, e.g. all red shirts (fh_location) sorted by margin (fh_sort_by). There are multiple ways to create an expression in the Fredhopper Query Language:
- For each navigation aid (e.g. facets) Fredhopper provides the corresponding query that has to be sent if the user clicks on it (method getUrlParams).
- You can build entry points manually via string composition, e.g. fh_location=//catalog01/en_US/brand=adidas for the adidas landing page.
- You can use the Query Language library for Java/.NET.
For other languages such as PHP, classic ASP and Perl we provide sample codes.
Query Result components
Fredhopper delivers the Query Result components that your front-end application will render in your presentation layer.
| Each element of the query result is documented in the Fredhopper XSD/WSDL and the JavaDoc of the SOAP classes. You can access the documents by visiting the following link (requires your Learning Centre LDAP credentials) https://extranet.fredhopper.com/fas/ Select your FAS version and then access the libraries section e.g. Rest /libraries/ws-client/ Java /libraries/query-lang/ |
Fredhopper provided the following query result components:
- Breadcrumb: Navigation aid that reflects the drill down path of the user which led him to the current location, e.g. Home > Women > Adidas or Home > Adidas > Women.
- Facetmap: Navigation aid to filter the result set
- Item lister: Paged list of items from Fredhopper's organic results
- Campaigns (called Themes in the Query API): Merchandising campaign that communicates targeted special offers next to Fredhopper's organic results. For example, marketers may promote bestsellers by showing the top 3 sellers - or inform customers about free delivery by showing a banner.
This image highlights how the Fredhopper Preview Pages are composed of the different query result components:
In addition, the Query Results components use the concept of Page view. Depending on the page view, a selection of the Query Results components are available:
| Page view | Breadcrumb | Facetmap | Item lister | Campaigns |
|---|---|---|---|---|
| Home (homepage) | Yes | Yes | No (configurable) | Yes |
| Summary (landing pages) | Yes | Yes | No | Yes |
| Lister (item list for browsing location) | Yes | Yes | Yes | Yes |
| Search results (item list for free text search) | Yes | Yes | Yes | Yes |
| Detail (details on a single item) | Yes | Yes (configurable) | Yes (just one) | Yes |
| Compare (details on multiple items for comparison) | Yes | Yes (configurable) | Yes | Yes |
Comments
0 comments
Please sign in to leave a comment.