Package de.cxp.ocs.config
Class SortOptionConfiguration
java.lang.Object
de.cxp.ocs.config.SortOptionConfiguration
Optional configuration that overwrites the default way to present and handle
sortings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreference field for which this sort configuration applies.Display label for the according sort option.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).Specify the sort order of that configured option.
-
Constructor Details
-
SortOptionConfiguration
public SortOptionConfiguration()
-
-
Method Details
-
setField
reference field for which this sort configuration applies.- Parameters:
field
- the field to set- Returns:
- self
-
setLabel
Display label for the according sort option. Should be unique across all the sort options.- Parameters:
label
- the label to set- Returns:
- self
-
setOrder
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
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
-