LPS-30175 Category list show less than maxTerms if frequencyThreshold > frequency

Re-based on latest changes from liferay repo