How to get instance of com.day.cq.search.Trends when using QueryBuilder | Community
Skip to main content
Level 3
October 16, 2015
Solved

How to get instance of com.day.cq.search.Trends when using QueryBuilder

  • October 16, 2015
  • 4 replies
  • 985 views

We have been using first com.day.cq.wcm.foundation.Search and then com.day.cq.search.SimpleSearch to do our sitewide searching. We're moving to using QueryBuilder now as neither of the other search classes provides the flexibility we need. My question is how do I get to the Trends object that is returned by Search and SimpleSearch? I can't find anything in the documentation that tells me how I can get an instance of that class.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

WHen using the QUeryBuilder API -a Trends instance is not returned.

QUeryBuilder API returns the result set in an instance of:

com.day.cq.search.result.SearchResult

See this community article to learn how to work with QueryBuilder API and how to get your result set:

https://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html

4 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

WHen using the QUeryBuilder API -a Trends instance is not returned.

QUeryBuilder API returns the result set in an instance of:

com.day.cq.search.result.SearchResult

See this community article to learn how to work with QueryBuilder API and how to get your result set:

https://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html

smacdonald2008
Level 10
October 16, 2015
Level 3
October 16, 2015

I guess that I'm surprised that we have this public interface defined but the only way to get an instance of an implementation is to first instantiate a SimpleSearch object. I had hoped that there was some other way to get hold of an instance.

Level 3
October 16, 2015

Thanks for the response. So is there no way to get the Trends when using QueryBuilder? I've read through the linked document and there's no mention of Trends at all there.