> But, how does this search-list work right now? Is the
> complete search-result present in the XML? Could that not be
> very memory-consuming, and should the resultset not be
> limited using 'max' and 'offset' features of the database?
Before I vote I like to know if the pagecount (resultSize) is correct. The
below code is from the list.jsp.
The query is limited with setMaxNumber and setOffset. Does this affect the
Queries.count(query)? I haven't looked at it indepth.
} else if (listConfig.multilevel) {
log.trace("this is a multilevel");
Query query = cloud.createQuery();
Queries.addPath(query, listConfig.nodePath, listConfig.searchDir); //
also possible to specify more than one searchDir
Queries.addSortOrders(query, listConfig.orderBy, listConfig.directions);
Queries.addFields(query, listConfig.fields);
Queries.addStartNodes(query, listConfig.startNodes);
Queries.addConstraints(query, listConfig.constraints);
query.setDistinct(listConfig.distinct);
query.setMaxNumber(len);
query.setOffset(start );
results = cloud.getList(query);
resultsSize = Queries.count(query);
} else {
log.trace("This is not a multilevel. Getting nodes from type " +
listConfig.nodePath);
NodeManager mgr = cloud.getNodeManager(listConfig.nodePath);
if (log.isDebugEnabled()) {
log.trace("directions: " + listConfig.directions);
}
NodeQuery q = mgr.createQuery();
Queries.addConstraints(q, listConfig.constraints);
Queries.addSortOrders(q, listConfig.orderBy, listConfig.directions);
q.setMaxNumber(len);
q.setOffset(start );
results = mgr.getList(q);
resultsSize = Queries.count(q);
}
Nico