Search Servlet not working - probably dependency issue



Hi, I've implemented research project on using Jackrabbit Oak Lucene, Apache Solr and Elasticsearch in AEM 6.4 on We Retail project. They are all implemented inside the same project so I could measure their results. You can check this project here:


However, there is one open issue that I am not able to resolve -


Search is not working on AEM 6.5 (not sure tho if it is related to the version), but it works for me on AEM 6.4 instance. The problem is with SearchServlet which looks like this:





(service = Servlet.class, property = { "sling.servlet.selectors=" + SearchServlet.DEFAULT_SELECTOR, "sling.servlet.resourceTypes=cq/Page",
  "sling.servlet.extensions=json", "sling.servlet.methods=" + HttpConstants.METHOD_GET })
public class SearchServlet extends SlingSafeMethodsServlet





I tried many variations of this, but it can not be called from this form:





<form class="cmp-search__form" data-cmp-hook-search="form" method="get" action="${currentPage.path @ addSelectors=['mysearchresults'], extension='json', suffix = search.relativePath}" autocomplete="off">





This is the error I get:





Invalid recursion selector value 'searchresultsdata'
Cannot serve request to /content/we-retail/language-masters/en/products.searchresultsdata.json/_jcr_content/root/header/search in






I think this is dependency issue where it can not recognise this servlet because of some dependency it uses (probably elasticsearch). Not sure how much sense this has, but I had similar problem in original implementation on 6.4 and it worked only after deploying Elasticsearch as separate bundle. In this case Servlet is completely blocked from processing requests either for Lucene, Solr or Elasticsearch.


To replicate the problem:

1. clone [master branch] project

2. deploy project on your AEM instance >= 6.4 (autoInstallSinglePackage)

3. open any page and click on search button on the right side of the header

4. search for term "sonja" (this jacket definitely exists in We Retail)


Any help will be appreciated.

Thank you

AEM aem6.5 dependency elasticsearch maven search servlet

Accepted Solutions (1)

Accepted Solutions (1)



This was solved by the following PR:

By checking out OSGi Components in the Web Console, I've realised there are configurations that this server is depending on that weren't active automatically. By setting them to the default I've managed to solve this issue.

Answers (0)