Query Service
The Query service builds the search expressions and then hands the expression to Elasticsearch. It also takes the query results and translates them back into a form that can be used by the storefront. The storefront does not need to know that the response was generated by Elasticsearch rather than Solr.
In HCL Commerce Search Version 9.1, search queries are built using the Query microservice. It is used to create the search queries that will be passed to the Elasticsearch engine. The query-building function was built into the Search Docker container in previous versions of HCL Commerce, but as a separate microservice is now easier to address and customize.
Controlling Query using REST
The Query and Ingest services are the only APIs that are visible from outside the gateway. The service exposes its own REST end points, as described in the Query service API specifications.
All these heuristics are applied in building the search query, which is then passed on to Elasticsearch.
- The Product view,
- Category view, and
- Content view.
All configurations, including search profile, runtime configurations, and cache invalidation, can be set up via the REST API, and are stored in ZooKeeper. You can use inheritance and value overrides when configuring your Search profiles. Any custom logic referenced by search profiles can be implemented and shipped in Java class files, packaged and rebuilt into a custom docker image
To review the API, see the Query REST API.
Natural Language Processor
- Natural language parsing with CoreNLP part-of-speech tagging, named entity extraction – nouns and names against brand and product names, and adjectives against attribute values
- Matchmaker for color name mapper, measurement, and dimension range mapper to identify attribute values in close proximity.
- Measurement conversion for length, weight, volume, date and time.
- Range filter that can identify a range condition in a given search phrase and map that into a range filter for search.
- Identifying the intent of the statement as "Buy."
- Doing name-entity-extraction using a custom dictionary (added through previous training) to identify "dress shoes" as a noun.
- Using "dress shoes" the noun to search against the Product Name catalog field.
- Identifying the part-of-speech "white" as an adjective and using it to search against Attribute catalog fields.
- Identifying the value "white" as a color name and normalizing it to the RGB code FFFFFF. "Light" colors can be normalized to anything with an RGB code greater than A0A0A0.
- At index time, normalizing the color name "cream" to a primary color family RGB code FFFFFF.
- Via text classification, identifying "dress shoes" (through a custom dictionary) is of "shoes" category and an additional filter with category name containing "shoe" (lemmatized).
For more information, see Natural Language Processing (NLP) in Version 9.1