[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Substrings in attributes - changing schemas



Thanks Hallvard,

I had already done slapindex2.4. (Tried now again, just in case. Nothing changed.)

Note, however, that I had not changed the schema (and I still haven't) !

As a test, in my test rig (on another machine also running the same version, with the same DIT) I did change the schema for the aRecord attribute (as I had suggested):

   attributetype ( 0.9.2342.19200300.100.1.26 NAME 'aRecord'
   EQUALITY caseIgnoreIA5Match
   SUBSTR caseIgnoreIA5SubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )

Then, in my slapd.conf I did:

   index aRecord pres,eq,sub

and finally stopped the server, indexed, restarted and it worked (both for partial and exact matches - this example is with an exact match):

   # service ldap2.4 stop
   Stopping slapd: [ OK ]
   #
   # cd /var/lib/ldap2.4
   # slapindex2.4
   # chown -R ldap:ldap /var/lib/ldap2.4
   #
   #
   # service ldap2.4 start
   Starting slapd (ldap + ldaps): [ OK ]
   #
   # ldapsearch2.4 -x -v -D "cn=Manager,dc=noa,dc=gr" -W -s sub -b
   "ou=dns1,dc=noa,dc=gr" arecord=195.251.202.63 dn
   ldap_initialize( <DEFAULT> )
   Enter LDAP Password:
   filter: arecord=195.251.202.63
   requesting: dn
   # extended LDIF
   #
   # LDAPv3
   # base <ou=dns1,dc=noa,dc=gr> with scope subtree
   # filter: arecord=195.251.202.63
   # requesting: dn
   #

   # nmilas1.astro, noa.gr, dns1, noa.gr
   dn: dc=nmilas1.astro,dc=noa.gr,ou=dns1,dc=noa,dc=gr

   # search result
   search: 2
   result: 0 Success

   # numResponses: 2
   # numEntries: 1

But why exact matches don't work with the attribute as it normally is in schema?

Nick


On 14/1/2011 1:44 μμ, Hallvard B Furuseth wrote:
Note that after messing with the schema of existing objects in your database,
at best you need to rebuild your indexes with slapindex (while slapd is down),
at worst you may have to slapcat the old database (with the old schema),
move away the database directory, and slapadd it back to a fresh database.