-
Type:
Bug
-
Status: Closed
-
Resolution: Duplicate
-
Affects Version/s: 7.0.0 DXP GA1
-
Component/s: Web Search > Search Widgets
-
Labels:None
While using APM tool to monitor Liferay, I noticed that when using Search portlet, the ES search index gets queried multiple times (8 times in my out-of-the-box setup). I'd expect the index to be queries only once, for best performance.
This is due to the fact that the /init.jsp initializes JSP variable searchDisplayContext and the class SearchDisplayContext is written in a such way that in the constructor of the class following code is always executed:
public SearchDisplayContext( ... throws Exception { ... Hits hits = facetedSearcher.search(searchContext); ... _hits = hits; _searchContext = searchContext; _searchContainer = searchContainer; }
/init.jsp is included from multiple JSPs throughout the Search portlet (using JSP directive <%@ include file="/init.jsp" %>). This include is also used from every JSP for all the facets being rendered, so the constructor gets called for every such JSP, querying index multiple times. In my test setup, each such invocation takes 20ms, which slow the performance of Search portlet considerably (20ms if written correctly vs. 8 x 20ms = 160ms now).
This can even result into behavior where different parts of the output work with different search results, if index changes between the individual JSP includes.
- duplicates
-
LPS-71326 Search portlet issues 3 identical sets of search queries per search
- Closed