10-26-2019 11:38 AM - edited 02-03-2024 5:33 PM
Hello Friends,
As per the documentation when we retrieve the Products using FlexibleSearch SAP Hybris recommends to get the data into ranges to improve the performance using below approach.
String query = "SELECT {" + UnitModel.PK + "} FROM {" + UnitModel._TYPECODE + "} ORDER BY " + UnitModel._TYPECODE;
final FlexibleSearchQuery fQuery = new FlexibleSearchQuery(query);
fQuery.setCount(range);
fQuery.setNeedTotal(true);
int start = 0;
final int range = 3;
int total;
do
{
fQuery.setStart(start);
final SearchResult<UnitModel> searchResult = flexibleSearchService.search(fQuery);
total = searchResult.getTotalCount();
start += range;
}
while (start < total);
i expected 3 items each iteration. But i am getting all the time full records from Product Table. Am I misssing anything here.
https://help.sap.com/doc/c74a78df6c654be3a432b9c1ab173d42/6.7.0.0/en-US/index.html
Thanks
Vinay Kumar Samudrala - Glad to see you after a long time.
There are two things that you need to consider w.r.t. the code you have posted:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.