-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.2.X, Master
-
Fix Version/s: 7.2.10 DXP FP5, 7.2.10.2 DXP SP2, 7.2.X, 7.3.10 DXP GA1, Master
-
Component/s: Search Infrastructure
-
Branch Version/s:7.2.x
-
Backported to Branch:Committed
-
Fix Priority:3
-
Sprint:Search|S03 Sprint 14| 4.6-4.27
-
Git Pull Request:
If you have some DDMFormInstance or DDMStructure objects, the search result count won't match with the quantity of results unless you add the "Type Facet" portlet to the search page.
Root cause
Search Result portlet gets a summary from each object returned from Elasticsearch using the AssetRenderer or the Indexer of the object.
In case there is a object without a valid summary, (for example DDMFormInstance or DDMStructure objects) that object will be discarted and won't be displayed in Search Result portlet body. This logic was added in LPS-72676.
However, the number of results that is displayed in the top of Search Result portlet will count them as this data comes directly from Elasticsearch searchResponse, without filtering the results.
For more information see following code:
- https://github.com/liferay/liferay-portal/blob/dedeb279e3dfed0f1d0074682df08b919ff4d5f9/modules/apps/portal-search/portal-search-web/src/main/java/com/liferay/portal/search/web/internal/result/display/builder/SearchResultSummaryDisplayBuilder.java#L321-L337
- https://github.com/liferay/liferay-portal/blob/dedeb279e3dfed0f1d0074682df08b919ff4d5f9/modules/apps/portal-search/portal-search-web/src/main/java/com/liferay/portal/search/web/internal/result/display/builder/SearchResultSummaryDisplayBuilder.java#L824-L863
- https://github.com/liferay/liferay-portal/blob/dedeb279e3dfed0f1d0074682df08b919ff4d5f9/modules/apps/portal-search/portal-search-web/src/main/java/com/liferay/portal/search/web/internal/search/results/portlet/SearchResultsPortlet.java#L287-L298
In the second link, it seems not having a AssetRenderer is ok if indexer is able to return a summary different to null
Additional note
Issue is not reproduced in case you add "Type Facet" portlet to the page, because that portlet adds a filter by entryClassName that doesn't include any entity without AssetRenderer, so it is not possible to have a null summary with that filter.
Steps to reproduce with Forms
- Create a new site, and enter inside it.
- Create the "home" page of the site
- Create the "search" page of the site
- Add "Search Result" portlet to the "search" page. Don't add any other portlet
- Go to WebContent section and create a webcontent called "test"
- Go to Forms section and create a form called "test" with a text field
- Go to "home" page and search "test" word:
- Expected behavior: the number of results displayed in the top of the "Search Result" portlet matches with the quantity of results
- Wrong behavior: the number of results displayed in the top of the "Search Result" portlet doesn't match with the number of results, it is greater than the real quantity of results
- Expected behavior: the number of results displayed in the top of the "Search Result" portlet matches with the quantity of results
Steps to reproduce with Webcontent Structures
- Create a new site, and enter inside it.
- Create the "home" page of the site
- Create the "search" page of the site
- Add "Search Result" portlet to the "search" page. Don't add any other portlet
- Go to WebContent section and create a webcontent called "test"
- Create a webcontent structure and call it test, also
- Go to "home" page and search "test" word:
- Expected behavior: the number of results displayed in the top of the "Search Result" portlet matches with the quantity of results
- Wrong behavior: the number of results displayed in the top of the "Search Result" portlet doesn't match with the number of results, it is greater than the real quantity of results
- Expected behavior: the number of results displayed in the top of the "Search Result" portlet matches with the quantity of results
- is related to
-
LPS-72676 Search Results Portlet crashes if search matches a tag name
- Closed