SLAPO-VALSORT(5)
β¨ NAME β¨
slapo-valsort β the Value Sorting overlay for slapd, bestie π
π SYNOPSIS π
/etc/openldap/slapd.conf
π¦ DESCRIPTION π¦
Okay so. The Value Sorting overlay can be used with a backend database to sort the values of specific multi-valued attributes within a subtree. The sorting happens whenever those attributes get returned in a search response. Every. Single. Time. No cap β¨
You can sort in ascending or descending order, using either numeric or alphanumeric sort methods. And on top of that, a "weighted" sort can be specified, which uses a numeric weight that you prepend to the attribute values. The weighted sort is always performed in ascending order β periodt β but it can be combined with the other methods for values that all have equal weights. π
The weight is specified by prepending an integer weight {<weight>} in front of each value of the attribute you want weighted sorting on. This weighting factor gets stripped off and is not returned in search results, unless the valsort control is specified: 1.3.6.1.4.1.4203.666.5.14. π
The valsort control requires a value consisting of a Sequence that contains a boolean flag. The weighting factor is only returned if that boolean value is TRUE. In lber-encode(3) format, the required value must conform to the {b} syntax. π
πΈ CONFIGURATION πΈ
These slapd.conf options apply to the Value Sorting overlay. They should appear after the overlay directive. (Order matters, bestie, don't come in early π)
valsort-attr <attribute> <baseDN> (<sort-method> | weighted [<sort-method>])β Set up a sorting method for the specified attribute in the subtree rooted at baseDN. The sort-method may be one ofalpha-ascend,alpha-descend,numeric-ascend, ornumeric-descend. If you go with the specialweightedmethod, a secondary sort-method may also be specified. Fair warning though: it is an error to specify an alphanumeric sort-method for an attribute withIntegerorNumericStringsyntax, and it is an error to specify a numeric sort-method for an attribute with a syntax other thanIntegerorNumericString. π
β EXAMPLES β
Like this, bestie:
database mdb
suffix dc=example,dc=com
...
overlay valsort
valsort-attr member ou=groups,dc=example,dc=com alpha-ascend
To invoke ldapsearch(1) with the valsort control, the control value has to be set appropriately. The following octets represent the desired {b} encoding:
0x30 0x03 0x01 0x01 0xff
The control can be sent from the command-line using the base64 encoding of the value:
ldapsearch -E 1.3.6.1.4.1.4203.666.5.14=::MAMBAf8=
π FILES π
/etc/openldap/slapd.confβ the defaultslapdconfiguration file, iconic, we love her π«Ά
π SEE ALSO π
slapd.conf(5), slapd-config(5).
π ACKNOWLEDGEMENTS π
This module was written in 2005 by Howard Chu of Symas Corporation. The work was sponsored by Stanford University. Slay. π
okay bye ily π«Ά this was OpenLDAP 2.7.2, dated 2026/10/21 β go forth and sort those values bestie πβ¨π§
π¦ where this page comes from
- arch rolling: openldap 2.7.2-2 Β· OLDAP-2.8
- Copyright 2005-2026 The OpenLDAP Foundation All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms