1

We are using AEM 6.3 and we have need to implement Content search functionality in our project.We implemented it using Search API provided but issue is that Search API take only request parameter and hence we are not able to cache the search result page.

Did try to use selector or set request attributes (searchTerm and Tags)and than create Search Client instance and call getResult method but it doesn't return any results.

As we need to do content search across pages and mutilple properties can we use QueryBuilder API here and achieve the same result provided by Search API

1 Answers1

2

Search API is highly performant and the caching is not the best strategy for using searches as you might get stale results. In practice, you end up reducing the cache lifetime and end up at the same problem.

You should look more into optimising your searches with proper indexes over targeted content etc.

However, if you really want to cache the search results you could look into 3rd party solutions but I would highly discourage it in the context of AEM as there are better solutions like:

  • Offloading searches to a dedicated publisher. You can do it via your LB or dispatcher rules.
  • Optimise searches by optimising indexes. Remember, indexes don't hit your repository.
  • Worst case if you really struggle with performance, look into AEM Solr integration as Solr has good caching. You can also achieve same with ElasticSearch or other DB. Just be warned that plumbing and TCO is not free for this.
Imran Saeed
  • 3,414
  • 1
  • 16
  • 27