Package de.cxp.ocs.config
Class SortOptionConfiguration
- java.lang.Object
-
- de.cxp.ocs.config.SortOptionConfiguration
-
public class SortOptionConfiguration extends Object
Optional configuration that overwrites the default way to present and handle sortings.
-
-
Constructor Summary
Constructors Constructor Description SortOptionConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SortOptionConfigurationsetField(String field)reference field for which this sort configuration applies.SortOptionConfigurationsetLabel(String label)Display label for the according sort option.SortOptionConfigurationsetMissing(String missing)SortOptionConfigurationsetOrder(SortOrder order)Specify the sort order of that configured option.
-
-
-
Method Detail
-
setField
public SortOptionConfiguration setField(String field)
reference field for which this sort configuration applies.- Parameters:
field- the field to set- Returns:
- self
-
setLabel
public SortOptionConfiguration setLabel(String label)
Display label for the according sort option. Should be unique across all the sort options.- Parameters:
label- the label to set- Returns:
- self
-
setOrder
public SortOptionConfiguration setOrder(SortOrder order)
Specify the sort order of that configured option. If null, this sort option will not be part of the result (but you could also skip the configuration of this option at all to achive that)- Parameters:
order- the order to set- Returns:
- self
-
setMissing
public SortOptionConfiguration setMissing(String missing)
From Elasticsearch documentation:The missing parameter specifies how docs which are missing the sort field should be treated: The missing value can be set to _last, _first, or a custom value (that will be used for missing docs as the sort value).
Other then the Elasticsearch default, the default in OCS is "0".
- Parameters:
missing- the missing to set- Returns:
- self
-
-