Issue
- Specification Facets are not functioning correctly in certain search scenarios, resulting in the 'Specification Facet is temporarily unavailable' error in the UI and below errors in the Liferay logs.
ERROR [http-nio-8080-exec-30][CPSpecificationOptionFacetsPortlet:74] null
java.lang.NullPointerException: null
at com.liferay.commerce.product.content.search.web.internal.display.context.builder.CPSpecificationOptionsFacetDisplayContextBuilder._buildCPSpecificationOptionsSearchFacetDisplayContext(CPSpecificationOptionsFacetDisplayContextBuilder.java:127) ~[bundleFile:?] -
Steps to reproduce:
- Setup a minium site and an account
- Go to Commerce/Specifications/Labels.
- From the 9 specifications already present, make sure to set as facetable those that are not.
- Then create new facetable specifications until have 20 of them. Since there are 9 specifications by default, create 11 additional ones: spec10, spec11,..., spec20
-
Go to Commerce/Products/ABS Sensor. It has 5 specifications already added, with positions from 0 to 4.
- Add the rest of the 15 specifications to the product. Make sure to edit each and add a value (anything, e.g. 1) and an increasing position accordingly (so from 5 to 19).
-
Go to Commerce/Specifications again and create one more facetable specification: spec21.
-
Go to Commerce/Products/ Shock Absorber
- Add this spec21 to the Shock Absorber. Add also value to it, and a position (e.g. 20).
- Go to minium UI and search for "abs" (go to http://localhost:8080/web/minium/catalog?q=abs)
- Search for "shock" (go to http://localhost:8080/web/minium/catalog?q=shock)
Expected Behavior: Both searches work and the user can use the specification facet.
Actual Behavior: In the latter search case, the user cannot use the specification facet and sees the errors mentioned in the issue description.
Environment
- Liferay DXP 7.4 u90
Resolution
- The observed behavior is a known bug that has been addressed by: COMMERCE-12191, LPD-20339; however, it was fixed in 2024.Q1.1.
- Also, increase the maxTerms on the Specification Facet Portlet Configuration up to the number or more than that which number of specifications has been present in the environment.
- If a hotfix is required for this issue, please create a support ticket requesting a hotfix by attaching patch details.
- Installing Fix Packs and Hotfixes on Liferay DXP will guide you to install this hotfix in the respective environment.
Additional Information