I think it’s something like:
filter = :eldap.and([
:eldap.substrings('cn', [{:any, to_charlist(filter_term)}]),
:eldap.or([
:eldap.equalityMatch('objectClass', 'user'),
:eldap.equalityMatch('objectClass', 'person'),
])
)])
but haven’t tried.