diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OBinaryCondition.java b/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OBinaryCondition.java index a9e90c512bd..921cd8292c2 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OBinaryCondition.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OBinaryCondition.java @@ -380,7 +380,7 @@ private OExpression fieldNamesToStrings(OExpression left) { } else if (left.mathExpression instanceof OBaseExpression) { OBaseExpression base = (OBaseExpression) left.mathExpression; if (base.getIdentifier() != null - && base.getIdentifier() != null + && base.getIdentifier().levelZero != null && base.getIdentifier().levelZero.collection != null) { OCollection coll = base.getIdentifier().levelZero.collection; diff --git a/lucene/src/main/java/com/orientechnologies/lucene/functions/OLuceneSearchOnFieldsFunction.java b/lucene/src/main/java/com/orientechnologies/lucene/functions/OLuceneSearchOnFieldsFunction.java index 4e223e58d57..c69876021b7 100644 --- a/lucene/src/main/java/com/orientechnologies/lucene/functions/OLuceneSearchOnFieldsFunction.java +++ b/lucene/src/main/java/com/orientechnologies/lucene/functions/OLuceneSearchOnFieldsFunction.java @@ -113,7 +113,7 @@ public Iterable searchFromTarget( OLuceneFullTextIndex index = searchForIndex(target, ctx, args); OExpression expression = args[1]; - String query = (String) expression.execute((OIdentifiable) null, ctx); + Object query = expression.execute((OIdentifiable) null, ctx); if (index != null) { ODocument meta = getMetadata(args, ctx); diff --git a/lucene/src/main/java/com/orientechnologies/spatial/shape/OShapeFactory.java b/lucene/src/main/java/com/orientechnologies/spatial/shape/OShapeFactory.java index c81ced8c3f9..49d67631160 100644 --- a/lucene/src/main/java/com/orientechnologies/spatial/shape/OShapeFactory.java +++ b/lucene/src/main/java/com/orientechnologies/spatial/shape/OShapeFactory.java @@ -124,6 +124,10 @@ public String asText(ODocument document) { @Override public String asText(Object obj) { + if (obj instanceof OResult) { + OElement oElement = ((OResult) obj).toElement(); + return asText((ODocument) oElement); + } if (obj instanceof ODocument) { return asText((ODocument) obj); }