use of com.orientechnologies.orient.core.sql.operator.OQueryOperatorBetween in project orientdb by orientechnologies.
the class OLuceneOperatorUtil method createIndexedProperty.
public static OIndexSearchResult createIndexedProperty(final OSQLFilterCondition iCondition, final Object iItem) {
if (iItem == null || !(iItem instanceof OSQLFilterItemField))
return null;
if (iCondition.getLeft() instanceof OSQLFilterItemField && iCondition.getRight() instanceof OSQLFilterItemField)
return null;
final OSQLFilterItemField item = (OSQLFilterItemField) iItem;
if (item.hasChainOperators() && !item.isFieldChain())
return null;
final Object origValue = iCondition.getLeft() == iItem ? iCondition.getRight() : iCondition.getLeft();
if (iCondition.getOperator() instanceof OQueryOperatorBetween || iCondition.getOperator() instanceof OQueryOperatorIn) {
return new OIndexSearchResult(iCondition.getOperator(), item.getFieldChain(), origValue);
}
final Object value = OSQLHelper.getValue(origValue);
if (value == null)
return null;
return new OIndexSearchResult(iCondition.getOperator(), item.getFieldChain(), value);
}
Aggregations