Enabling price facet hiding and sequencing
Follow the steps given in this document to enable the price facet hiding and sequencing in both e-site and CAS models.
About this task
Procedure
-
For e-site model:
-
Obtain SRCHATTR_ID. Run the following SQL query to
retrieve the SRCHATTR_ID for the offer price in
store-supported currency, such as US dollar, and note down the
SRCHATTR_ID for example, -1016.
SELECT * FROM SRCHATTR WHERE IDENTIFIER LIKE '%OfferPrice_USD';
-
Obtain DatabaseCategoryStage1b.sql.
Navigate to the current Nifi image and copy the DatabaseCategoryStage1b.sql from the Nifi image. Use the following command in the docker-compose environment:
Extract thedocker cp commerce_nifi_1:/opt/nifi/nifi-current/extensions/commerce-search-processors-nar-<release>.nar ./
DatabaseCategoryStage1b.sql
from the nar file using a zip tool such as 7-zip. Locate the SQL file within the extracted files at the following location: META-INF\bundled-dependencies\commerce-search-processors-<release>.jar\sql\ -
Modify the DatabaseCategoryStage1b.sql.
Open the DatabaseCategoryStage1b.sql file and add
SRCHATTR
obtained from 1.a to the following section and save the modifications made to the file - For example, -1016.WHERE SA.SRCHATTR_ID = F.SRCHATTR_ID AND SA.SRCHATTR_ID IN (-1002, -1013, -1101, -1016)
-
Configure the Nifi user interface. In the NIFI user interface, navigate
to the following processors and execute the given steps:
auth.reindex
- Category Stage 1b (Find Facets)auth.category
- Category Stage 1b (Find Facets)dataload.category
- Category Stage 1b (Find Facets)
- Find the corresponding property related to executing SQL.
- Update the
Custom SQL Value
by copying the content of the modified DatabaseCategoryStage1b.sql file. - Remove leading whitespace characters from the SQL to avoid any issues.
- Set
Use Custom SQL
to Yes.
-
Obtain SRCHATTR_ID. Run the following SQL query to
retrieve the SRCHATTR_ID for the offer price in
store-supported currency, such as US dollar, and note down the
SRCHATTR_ID for example, -1016.
-
For CAS model:
- Follow the step 1.a to obtain the SRCHATTR_ID.
-
Determine if
LISTAGG
is enabled or disabled.- If
LISTAGG
is enabled, extract the DatabaseCASCategoryStage1b-listagg.sql file. - If
LISTAGG
is disabled, extract the DatabaseCASCategoryStage1b.sql file. - In either case, add
SRCHATTR_ID
in the SQL query section whereSA.SRCHATTR_ID
is being compared toF.SRCHATTR_ID
. For example,WHERE SA.SRCHATTR_ID = F.SRCHATTR_ID AND SA.SRCHATTR_ID IN (-1002, -1013, -1101, -1016)
- If
-
Follow step 1.d to
Find Facets SQL
orFind Facets SQL - LISTAGG
processor in the following components:auth.reindex.cas
- Category Stage 1b (Find Facets)auth.category.cas
- Category Stage 1b (Find Facets)auth.dataload.cas
- Category Stage 1b (Find Facets)