/* index.c - routines for dealing with attribute indexes */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
return mask;
}
- /* If there is a language tag, did we ever index the base
+ /* If there is a tagging option, did we ever index the base
* type? If so, check for mask, otherwise it's not there.
*/
- if( slap_ad_is_lang( desc ) && desc != desc->ad_type->sat_ad ) {
- /* has language tag */
+ if( slap_ad_is_tagged( desc ) && desc != desc->ad_type->sat_ad ) {
+ /* has tagging option */
attr_mask( be->be_private, desc->ad_type->sat_ad, &mask );
- if( mask && ( mask ^ SLAP_INDEX_NOLANG ) ) {
+ if( mask && ( mask ^ SLAP_INDEX_NOTAGS ) ) {
*atname = desc->ad_type->sat_cname;
*dbname = desc->ad_type->sat_cname.bv_val;
return mask;
if ( db == NULL ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "index", LDAP_LEVEL_ERR,
- "index_read: Could not open db %s%s\n",
- dbname, LDBM_SUFFIX ));
+ LDAP_LOG( INDEX, ERR,
+ "index_read: Could not open db %s%s\n", dbname, LDBM_SUFFIX, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= index_read NULL (could not open %s%s)\n",
static int index_at_values(
Backend *be,
AttributeType *type,
- struct berval *lang,
+ struct berval *tags,
BerVarray vals,
ID id,
int op )
if( type->sat_sup ) {
/* recurse */
(void) index_at_values( be,
- type->sat_sup, lang,
+ type->sat_sup, tags,
vals, id, op );
}
mask );
}
- if( lang->bv_len ) {
+ if( tags->bv_len ) {
AttributeDescription *desc;
mask = 0;
- desc = ad_find_lang(type, lang);
+ desc = ad_find_tags(type, tags);
if( desc ) {
attr_mask( be->be_private, desc, &mask );
}
int op )
{
(void) index_at_values( be,
- desc->ad_type, &desc->ad_lang,
+ desc->ad_type, &desc->ad_tags,
vals, id, op );
return LDAP_SUCCESS;
int
index_entry(
- Backend *be,
+ Backend *be,
int op,
- Entry *e,
- Attribute *ap )
+ Entry *e )
{
+ Attribute *ap = e->e_attrs;
#ifdef NEW_LOGGING
- LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
- "index_entry: %s (%s)%ld\n",
- op == SLAP_INDEX_ADD_OP ? "add" : "del",
- e->e_dn, e->e_id ));
+ LDAP_LOG( INDEX, ENTRY,
+ "index_entry: %s (%s)%ld\n", op == SLAP_INDEX_ADD_OP ? "add" : "del",
+ e->e_dn, e->e_id );
#else
Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",
/* add each attribute to the indexes */
for ( ; ap != NULL; ap = ap->a_next ) {
- index_values( be, ap->a_desc, ap->a_vals, e->e_id, op );
+ index_values( be, ap->a_desc,
+#ifdef SLAP_NVALUES
+ ap->a_nvals,
+#else
+ ap->a_vals,
+#endif
+ e->e_id, op );
}
#ifdef NEW_LOGGING
- LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
- "index_entry: success\n" ));
+ LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",