Package de.cxp.ocs.smartsuggest.limiter
Class GroupedCutOffLimiter
- java.lang.Object
-
- de.cxp.ocs.smartsuggest.limiter.GroupedCutOffLimiter
-
- All Implemented Interfaces:
Limiter
public class GroupedCutOffLimiter extends Object implements Limiter
This limiter groups the result by the specified payload entry and limits each group to the specified size. If the final list is longer than the requested limit, the least important group is truncated accordingly.
If the final list is shorter as the requested limit, nothing is done, so it will stay short! Only exception: if there are suggestions from a group that was not configured, they are appended to the final list, but not more than specified by the "defaultLimit".
With the optional given "groupDeduplicationOrder", the suggestions will be deduplicated. The array defines preferred groups. Suggestions of the groups defined first will be preferred over suggestions from other groups.
-
-
Field Summary
Fields Modifier and Type Field Description static StringOTHER_SHARE_KEY
-
Constructor Summary
Constructors Constructor Description GroupedCutOffLimiter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Suggestion>limit(List<Suggestion> suggestions, int limit)
-
-
-
Field Detail
-
OTHER_SHARE_KEY
public static final String OTHER_SHARE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
limit
public List<Suggestion> limit(List<Suggestion> suggestions, int limit)
-
-