1 min read

Algolia SDK

The Poq Algolia SDK contains Poq specific services to speed up integration of Algolia in Poq BFC.

List of Features

The Poq Algolia SDK provides Contracts and Services that facilitates integration of the Poq Platform with the Algolia API. Here is the list of features by their namespace.

Contract

Namespace contains contacts of Poq Algolia SDK API.

Services

Namespace contains Poq specific services.

  • ISearchService - provides implementation
  • ISearchParamsConverter - provides implementation
  • ISearchListingConverter - MUST be implemented

Limitations

Implementation does not fully cover the entire Algolia API. Future development should fill integration gaps.

The functionality of the nuget does not provide plug&play integration unless the items stored in Algolia search index do match Poq ProductListing contract. The provided implementation covers basics:

  • filtering on category, price, color and size with the presumption that appropriate facets have been defined in Algolia search index configuration.
  • ordering by name and price when such replica indexes are configured in Algolia.

Extension Points

Future development will add implementations for missing endpoints. New services will be added to speed up development using Algolia SDK.

How to develop on top of this solution

In order to use the Algolia API directly, developers can use Algolia.Search nuget provided by Algolia. Algolia SDK provides SearchService which combined with custom implementation of ISearchListingConverter covers all PLP functionalities.

Example SearchService Usage

Using SearchService to handle incoming PLP requests

var configuration = new AlgoliaConfiguration(){ ... };
var searchClient = new SearchClient(configuration.Config.ApplicationId, configuration.Config.SearchOnlyApiKey);
ISearchParamsConverter paramsConverter = new SearchParamsConverter(configuration);
ISearchListingConverter listingConverter = new SearchListingConverter(); // Required customization point
ISearchService searchService = new Poq.Algolia.Services.SearchService(searchClient, config.Object, paramsConverter, listingConverter);
var response = await searchService.SearchAsync(appIdentifier, "GBP", new QueryCollection());

Breaking Changes

No breaking changes.