Virtual attributes do not mix well with indexing. You cannot index the values of a virtual attribute since these values can change from one invocation to the next.

Some virtual attributes do implement support for an index-like functionality in that they offer logic that may be able to quickly identify entries that have specified virtual attribute values. These include the following:
  • When mirroring values from another attribute in the same entry, and when that source attribute type is indexed, the mirror virtual attribute provider can use an internal search to identify matching entries.
  • The entryDN virtual attribute provider can retrieve the entry with the specified DN.
  • The isMemberOf virtual attribute provider can use the server’s group manager to identify the members of a targeted group.

However, this is not an option for all types of virtual attributes. For example, it is not available for user-defined virtual attributes that have a static value, for constructed virtual attributes whose values are composed from multiple other attributes in the same entry, for mirror virtual attributes whose values come from other entries, or for any custom virtual attribute types implemented using the Server SDK.

In addition, there is not a good solution for the case where you want to have a mix of real and virtual values for the same attribute type (whether in the same entry or in different entries). If you define an index for that attribute type, it will only include entries with real values; entries with virtual values will be overlooked. On the other hand, if there is no index but the virtual attribute provider does support some search functionality, only entries with virtual values will be matched and entries with only real values will be excluded.