use of com.day.cq.search.Predicate in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ListImpl method populateSearchListItems.
private void populateSearchListItems() {
listItems = new ArrayList<>();
if (!StringUtils.isBlank(query)) {
SimpleSearch search = resource.adaptTo(SimpleSearch.class);
if (search != null) {
search.setQuery(query);
search.setSearchIn(startIn);
search.addPredicate(new Predicate("type", "type").set("type", NameConstants.NT_PAGE));
search.setHitsPerPage(limit);
try {
collectSearchResults(search.getResult());
} catch (RepositoryException e) {
LOGGER.error("Unable to retrieve search results for query.", e);
}
}
}
}
Aggregations