Indexing via CLI

In regards to the previous post, another task that you would want automated is indexing. Although reindexing is not an bigger issue, adding new indexes might be more tricky if you don't have GUI. With Sun Java System Directory Server 6.0 is not such an issue since it comes with nice CLI tools, but version 5.2 requires reconfiguring using LDIF if the GUI is not available. The actual LDIF is quite simple:


dn: cn=$ATTRIBUE,cn=index,cn=$BACKEND_DB,cn=ldbm database,cn=plugins,cn=config
changetype: add
objectClass: top
objectClass: nsIndex
cn: $ATTRIBUE
nsIndexType: pres
nsIndexType: eq
nsIndexType: sub
nsSystemIndex: false


$ATTRIBUTE - name of the attribute that you want to have indexed;

$BACKEND_DB - backend database which holds the suffix which will be indexed, e.g. by default backend database is "userRoot" for the root suffix;

nsIndexType - specifies the type of the index - it could be: pres(ence), eq(uality), sub(string) and approx(imate). If nsIndexType is left empty, it means all index types would be created for this attribute.

UPDATE:

In response to Ludovic's comment below, I need to add a few notes. As Ludovic mentioned, and I failed stress it, this will only configure the indexes without actually creating them. The reindexing is easily performed from the CLI by running db2index\* tool, hence no additional toying with LDIF is needed.

Thanks for drawing my attention!

Comments:

Hi Nemanja, What you describe here is just the first step of configuring new index in Directory Server 5.2. Once you have added the index configuration, you must tell the server to build / rebuild the index. You can do this with the db2index or db2index.pl command line tool. Regards, Ludovic.

Posted by Ludo on март 27, 2007 at 09:46 AM CEST #

Point taken!

Posted by Nemanja on март 27, 2007 at 10:35 AM CEST #

Post a Comment:
Comments are closed for this entry.
About

Publishing quirks of Sun software popped up during integration.

Search

Categories
Archives
« април 2014
понутосречетпетсубнед
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today