cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Export products to Excel only export those from the current page

phoude
Participant
0 Kudos
662

I want to export to Excel the result of a product search returning about 80000 items. After export process is completed, I download the Excel file but it only contains 50 items which is the number of items shown in a single page. I do not select individual items on my product search. I also get the prompt saying that I am about to export 80000 items. If Hybris knows that I am exporting 80000 items then why does it only export 50. There are no error in the console log.

I am on version 2011.22

View Entire Topic
former_member724115
Discoverer
0 Kudos

I faced the same problem with version 1905.43. I found that in method getAllResults() of DefaultPlatformFieldSearchFacadeStrategy.BackofficeFlexibleSearchPageable, the green line should use clonedQuery instead of query according to previous version. I'm thinking that this might be a bug from SAP upgrade.

Maybe this will help.

phoude
Participant
0 Kudos

You are right on! The implementation did change on patch 22 reverting to query as opposed to using clonedQuery as it is the case for patch 22. I will raise a SAP ticket. Thanks!

Hybris 2011.21:

public List<T> getAllResults() {
GenericSearchQuery clonedQuery = new GenericSearchQuery(this.query.getQuery());
clonedQuery.setStart(0);
clonedQuery.setCount(this.getTotalCount());
clonedQuery.setNeedTotal(false);
if (DefaultPlatformFieldSearchFacadeStrategy.this.typeService.getTypeForCode(this.getTypeCode()) instanceof ViewTypeModel) {
SearchResult jaloSearchResult = JaloSession.getCurrentSession().search(clonedQuery.getQuery());
return jaloSearchResult != null ? jaloSearchResult.getResult() : Collections.emptyList();
} else {
de.hybris.platform.servicelayer.search.SearchResult<T> searchResult = DefaultPlatformFieldSearchFacadeStrategy.this.getGenericSearchService().search(clonedQuery);
return searchResult != null ? searchResult.getResult() : Collections.emptyList();
}
}

Hybris 2011.22:

public List<T> getAllResults() {
        GenericSearchQuery clonedQuery = new GenericSearchQuery(this.query.getQuery());
        clonedQuery.setStart(0);
        clonedQuery.setCount(this.getTotalCount());
        clonedQuery.setNeedTotal(false);
        if (this.this$0.typeService.getTypeForCode(this.getTypeCode()) instanceof ViewTypeModel) {
            SearchResult jaloSearchResult = JaloSession.getCurrentSession().search(clonedQuery.getQuery());
            return jaloSearchResult != null ? jaloSearchResult.getResult() : Collections.emptyList();
        } else {
            de.hybris.platform.servicelayer.search.SearchResult<T> searchResult = this.searchWithReadReplicaIfPossible(this.query);
            return searchResult != null ? searchResult.getResult() : Collections.emptyList();
        }
    }
phoude
Participant
0 Kudos

Fixed in 2011.23. I don't know why this issue keeps coming back. It is like one dev undoing the work of another dev because of a conflicting bug