Forum Stats

  • 3,854,298 Users
  • 2,264,349 Discussions


How to get cm:search to use the max attribute when creating the SQL query?

657507 Member Posts: 4
edited Oct 3, 2008 2:15PM in WebLogic Portal
When we use the max attribute in the cm:search tag, it does not seem to honor the max attribute when creating the SQL query. However, the result returned from the tag is limited to the number specified by the max attribute. Then the tag seems to work as intended, but the performance will be sub optimal when the SQL query returns unnecessary rows to the application.

We use the cm:search tag to list the latest news (ordered by date), and with the current implementation we have to expect a decrease in performance over time as more news is published. But we can’t live with that. We need to do the constraint in the SQL query, not in the application.

The sortBy attribute of cm:search is translated to “order by” in the SQL query, as expected.

Is it possible to get cm:search to generate the SQL query with an addition of “where rownum <= maxRows”?


  • 648838
    648838 Member Posts: 36
    Hi Erik,

    The behavior of a repository in regards to the search tag's max results parameter is dependent on the underlying repository's implementation. That said, the OOTB repository in WLP does augment the generated SQL to limit the number of rows returned from the database. This is done in the parsing logic. This behavior may differ with other repository implementations.

This discussion has been closed.