Commerce Search v3 product search pipeline
Details Optimizely Configured Commerce Search v3, explaining how it integrates Google Retail Search and Elasticsearch v7 for product searches, utilizing the RunProductSearch shared pipeline, and highlighting their distinct operational approaches.
Optimizely Configured Commerce Search v3 uses Google Retail Search for relevancy-based product searches and Elasticsearch v7 for non-relevancy-based searches. Both search engines execute the RunProductSearch shared search pipeline to perform product searches.
Elasticsearch v7 uses the shared pipeline as is, without overriding any of its pipes. Google Cloud Retail Search, however, overrides some pipes to support the Retail Search APIs.
The following sections outline how Google Cloud Retail Search extends the base RunProductSearch shared search pipeline with retail search-specific implementations.
Differences
- Consolidated search – Google Cloud Retail Search combines the two separate search calls (
PerformAggregationSearchat2700andPerformSearchat3700) into a single API call at pipe2700. This eliminates needing a separate main search query. - Reordered pipeline – Some pipes execute earlier in the pipeline (
ApplyQueryAndFilterandApplyPaging) to prepare the complete search descriptor before the single combined search call.
Overridden pipes
Order | Pipe | Changes from base |
|---|---|---|
|
| Enhanced
|
|
| Skipped – Returns result without creating customer name queries. Google Retail Search does not support customer-specific product filtering. |
|
| Skipped – Returns result. Google Retail Search does not support previously purchased product boosting. |
|
| Replaced
|
|
| Modified – Adds additional check to skip if Auto Correct Enabled is true (autocorrect takes precedence over did-you-mean). |
|
| Replaced
|
Reordered pipes
| Order | Pipe | Original Order | Changes |
|---|---|---|---|
2630 | ApplyQueryAndFilter | 3500 | Moved earlier and simplified – Does not have FunctionScore query support, sponsored products filter exclusion, and ScoreFunctions collection handling. Only combines CombinedQuery and CombinedFilter using BooleanQuery with Operation.And. |
2670 | ApplyPaging | 3600 | Moved earlier – Adds PageToken support with .WithPageToken(result.PageToken). Otherwise, it is identical to base implementation. |
New pipes
Order | Pipe | Description |
|---|---|---|
|
| Applies Google Cloud Retail Search query expansion feature by calling |
|
| Replaces
|
|
| Explicitly overrides the base |
|
| Sets Google Cloud Retail Search specific response fields from the search response:
|
Execution flow for Google Cloud Retail Search
The modified pipeline flow is the following:
- Pipes 100-2600 – Is the same as base pipeline (query building, aggregation setup, and suggestions).
- Pipe 2630:
ApplyQueryAndFilter– Combines query and filter. Moved from3500. - Pipe 2650:
ApplyQueryExpansion– Applies query expansion - Pipe 2670:
ApplyPaging– Applies pagination withPageTokensupport. Moved from3600. - Pipe 2700:
PerformAggregationAndSearch– Replaces2700and3700with a single combined search call. - Pipes 2800-3400 – Process aggregations and sponsored search (same as base).
- Pipe 3500:
ApplyQueryAndFilter– Does not run (already executed at2630). - Pipe 3600:
ApplyPaging– Does not run (already executed at2670). - Pipe 3700:
SkipPerformSearch– Explicitly skips the basePerformSearch. - Pipes 3800-3900 – Process search response and pagination (same as base).
- Pipe 3810:
SetAdditionalFields– Set Google-specific response fields. - Pipes 4000-4200 – Process explanations and suggestions (same as base).
Skipped base pipes
The following base pipes are skipped in Google Cloud Retail Search:
| Order | Pipe | Changes |
|---|---|---|
700 | FormCustomerNameQuery | Overridden to skip (customer-specific products not supported). |
1000 | FormPreviouslyPurchasedProductQuery | Overridden to skip (not supported). |
2700 | PerformAggregationSearch | Merged into 2700 PerformAggregationAndSearch. |
3500 | ApplyQueryAndFilter | Moved to 2630 (base implementation at 3500 does not execute). |
3600 | ApplyPaging | Moved to 2670 (base implementation at 3600 does not execute). |
3700 | PerformSearch | Replaced by 3700 SkipPerformSearch. |
Updated about 17 hours ago
