if (iItem == null || !(iItem instanceof OSQLFilterItemField))
return false;
OSQLFilterItemField item = (OSQLFilterItemField) iItem;
final OProperty prop = iSchemaClass.getProperty(item.getName());
if (prop != null && prop.isIndexed()) {
// TODO: IMPROVE THIS MANAGEMENT
// ONLY EQUALS IS SUPPORTED NOW!
OIndex idx = prop.getIndex().getUnderlying();
idx = idx.getInternal();
if (((idx instanceof OIndexUnique || idx instanceof OIndexNotUnique) && iCondition.getOperator() instanceof OQueryOperatorEquals)
|| idx instanceof OIndexFullText && iCondition.getOperator() instanceof OQueryOperatorContainsText) {
Object value = iCondition.getLeft() == iItem ? iCondition.getRight() : iCondition.getLeft();
if (value != null) {
if (value instanceof OSQLFilterItemParameter)
value = ((OSQLFilterItemParameter) value).getValue(null);
final Collection<?> resultSet = prop.getIndex().getUnderlying().get(value);
if (resultSet != null && resultSet.size() > 0)
for (Object o : resultSet) {
if (o instanceof ORID)
iResultSet.add(database.load((ORID) o));
else