8.4. Using Views
8.4.1. About Views
nsview) and a filter attribute (
nsviewfilter) that set up a filter for the entries which belong in that view. Once the view container entry is added, all of the entries that match the view filter instantly populate the view. The target entries only appear to exist in the view; their true location never changes. For example, a view may be created as
ou=Location Views, and a filter is set for
l=Mountain View. Every entry, such as
cn=Jane Smith,l=Mountain View,ou=People,dc=example,dc=com, is immediately listed under the
ou=Location Viewsentry, but the real
cn=Jane Smithentry remains in the
Figure 8.4. A Directory Tree with a Virtual DIT View hierarchy
Example-views.ldif, installed with Directory Server. This file is in the
/usr/share/dirsrv/data/directory. The sections in this chapter assume
Example-views.ldifis imported to the server.
8.4.2. Creating Views from the Command Line
- Use the
ldapmodifyutility to bind to the server and prepare it to add the new view entry to the configuration file.
- Assuming the view container
ou=Location Views,dc=example,dc=comfrom the
Example-views.ldiffile is in the Directory Server, add the new views container entry, in this example, under the
dc=example,dc=comroot suffix. This entry must have the
nsviewobject class and the
nsViewFilterattribute sets the attribute-value which identifies entries that belong in the view.
dn: ou=Mountain View,ou=Location Views,dc=example,dc=com changetype: add objectClass: top objectClass: organizationalUnit objectClass: nsview ou: Mountain View nsViewFilter: l=Mountain View description: views categorized by location
8.4.3. Improving Views Performance
nsViewFilterattribute; the rest of the filter is based on the entry hierarchy, looking for the
parentidof the real entries included in the view.
parentid, or the attribute set in
nsViewFilter— are not indexed, then the views search becomes an unindexed search because the views operation searches the entire tree for matching entries.
parentid, and the attribute set in