Limit the result rows in flexible search

Sometimes, we want to limit the no. of rows in results while we testing the flexible search query from the HAC. Flexible search query supports most of the SQL clauses. So we can use LIMIT or TOP in your query but it's database specific. it might not work with Oracle.

e.g
SELECT * FROM {Product} LIMIT 100
or
SELECT TOP 100 * FROM {Product}
For Oracle
SELECT * FROM {Product} WHERE rownum <= 100



Though API
final FlexibleSearchQuery query = new FlexibleSearchQuery("SELECT * FROM {Product}");
query.setCount(100);


Author Image

Ankitkumar Patel

Sr. SAP Hybris consultant, having 6+ years experience in Hybris, Java, J2EE. Extensive hands-on experience in SAP Hybris development, third-party integrations with Hybris, project architecture and design... Read more

Comments

Popular posts from this blog

Hybris flexible search query examples

How to remove or update all data records in Hybris?

Hybris backoffice customization