HCL Commerce Version 9.1.15.0 or later

Search API Endpoints

The Query Runtime allows you to customize existing Query service features, classes, controllers, and indexes.

Query Runtime

If you need to make use existing query service features, classes, controllers or make use of existing index then you can use Query Runtime customisation. To access this customization service, call the performSearch method from the SearchServiceFacade object provided as part of the query-api.jar.

The chief advantage of this approach is that it permits you to use all the expression providers, pre-post processors, search criteria objects, and control Parameters which are provided along in query-api.jar. You can add your own customization on top of one of these existing endpoints. This assumes that your customizations will be called via the standard Query service endpoint.

For example, suppose that you need to show only a particular brand’s product, of a particular color, and allow search based on color. In such a case you can create your own custom endpoint for product search and color as a parameter.

Querying Elasticsearch directly

  • If you need an entirely new endpoint for your requirement, you can create it using JAVA APIs provided by ElasticSearch.
  • In this case, declare your custom handler package com.samplecompany.search.rest against the scan.packages key as comma separated values in the application.properties customization file located at: /opt/WebSphere/Liberty/usr/servers/default/apps/search-query.ear/search-query.war/WEB-INF/classes inside the query-service container.

For more information, see https://help.hcltechsw.com/commerce/9.1.0/search/tasks/t_customizeQueryService.html