Logging searched keywords in 7.1

Jan Tošovský, modified 6 Years ago. Liferay Master Posts: 576 Join Date: 7/22/10 Recent Posts

My goal is to log all the searched keywords for long-term goal to have a better coverage of these topics in our documentation.

In LR 6.2 I had a custom hook for  /search/validate struts path extending the BaseStrutsAction:

public class SearchKeywordsAction extends BaseStrutsAction {

    @Override
    public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {

        String keywords = ParamUtil.get(request, "keywords", "");
        String namespace = ParamUtil.get(request, "namespace", "");

        ...
        return "";
    }
}

 

I am trying to migrate this into 7.1, but the search seems to be completely rewritten.  I'd like to put my customization to some low level method which is executed for any search request to avoid repeating this code for any portlet with the search field.