We have a custom string attribute in our ldap schema that tracks the status of the user's account. If the attribute is indexed any search query which filters on that specific attribute fails to return any results. If I remove the index on that attribute then everything runs fine. While this is not a show stopper, it would still be nice to index this particular attribute since it is used in filters very often.
I was wondering if someone has noticed similar behavior and what the solution might be. We have other custom attributes are being indexed and functioning correctly.
Thanks in advance -sud
--On Tuesday, June 05, 2007 7:19 PM -0500 sudhakar sudhakar@co.brazos.tx.us wrote:
We have a custom string attribute in our ldap schema that tracks the status of the user's account. If the attribute is indexed any search query which filters on that specific attribute fails to return any results. If I remove the index on that attribute then everything runs fine. While this is not a show stopper, it would still be nice to index this particular attribute since it is used in filters very often.
I was wondering if someone has noticed similar behavior and what the solution might be. We have other custom attributes are being indexed and functioning correctly.
If you add an index to an attribute that already exists, you *must* stop slapd and run slapindex.
--Quanah
-- Quanah Gibson-Mount Principal Software Engineer Zimbra, Inc -------------------- Zimbra :: the leader in open source messaging and collaboration
On Wednesday, 6 June 2007, sudhakar wrote:
If the attribute is indexed
No, if you have told slapd to index the attribute and use this index, but you have not indexed the existing entries, slapd believes what you told it (there is an index, it should not traverse the whole directory), and finds nothing in the index you told it to use. (If it were to subsequently traverse the whole directory, there would be no point in using an index).
You need to populate the index, by running slapdindex (any time you add indexes).
Regards, Buchan
Thank you. I did run slapindex under the assumption that it would index all (we have two) the databases. Looks like it wasn't. When I ran slapindex -b <suffix> the index was created and the filter works as expected.
Thanks for the help again. sudhakar
Buchan Milne wrote:
On Wednesday, 6 June 2007, sudhakar wrote:
If the attribute is indexed
No, if you have told slapd to index the attribute and use this index, but you have not indexed the existing entries, slapd believes what you told it (there is an index, it should not traverse the whole directory), and finds nothing in the index you told it to use. (If it were to subsequently traverse the whole directory, there would be no point in using an index).
You need to populate the index, by running slapdindex (any time you add indexes).
Regards, Buchan
openldap-software@openldap.org