[Date Prev][Date Next]
Re: Two index questions
> Hi all,
> Today I have two questions involving indexing. First, my understanding
> is that if a new index has been added to slapd.conf, it won't be used
> until slapd is stopped, slapindex is run and slapd is started again.
This is correct, since slapd needs to be restarted in order to read the
modified slapd.conf. If you just modify the file, slapd won't know it's
been modified. On the contrary, if you add the index by modifying
cn=config accordingly, slapd does not need to be restarted, and slapindex
does not need to be run.
> However, if there aren't any entries yet in the database that carry a
> new attribute to be indexed, then there's actually nothing to index.
> Also, the man page for it states that "Slapindex is used to
> regenerate slapd(8) indices based upon the current contents of a
> database." Could this also be a hint that slapindex does need relevant
> data to process before it can produce any indices? I expect to be
> wrong about this, but I'd rather be sure.
Correct. If you know for sure that the newly indexed attribute is not
contained in any entry in the database, you don't need to run slapindex.
> Second, regarding consumers, if a new index is added to a provider,
> does the same index also have to be added and (re)generated with
> slapindex on its consumers before it will be available there as well?
> I would expect so, but again, I'm not completely certain.
If you want to index that attribute on the consumer, then you need to stop
it, reconfigure it accordingly, run slapindex and restart slapd. There is
no strict requirement about having identical indexes on the producer and
on the consumers. However, it makes sense that if an attribute needs to
be indexed, it needs to be everywhere.