if ( idx != null )
{
return idx.reverseLessOrEq( indexEntry.getId(), node.getValue().get() );
}
ServerEntry entry = indexEntry.getObject();
// resuscitate the entry if it has not been and set entry in IndexEntry
if ( null == entry )
{
entry = db.lookup( indexEntry.getId() );
indexEntry.setObject( entry );
}
if ( null == entry )
{
return false;
}
// get the attribute
ServerAttribute attr = ( ServerAttribute ) entry.get( type );
// if the attribute does not exist just return false
//noinspection unchecked
if ( attr != null && evaluate( ( IndexEntry<Object, ServerEntry, ID> ) indexEntry, attr ) )
{
return true;
}
// If we do not have the attribute, loop through the sub classes of
// the attributeType. Perhaps the entry has an attribute value of a
// subtype (descendant) that will produce a match
if ( schemaManager.getAttributeTypeRegistry().hasDescendants( node.getAttribute() ) )
{
// TODO check to see if descendant handling is necessary for the
// index so we can match properly even when for example a name
// attribute is used instead of more specific commonName
Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
node.getAttribute() );
while ( descendants.hasNext() )
{
AttributeType descendant = descendants.next();
attr = ( ServerAttribute ) entry.get( descendant );
//noinspection unchecked
if ( attr != null && evaluate( ( IndexEntry<Object, ServerEntry, ID> ) indexEntry, attr ) )
{
return true;