Skip to content

Commit

Permalink
Surport for String.contains(), outside OPERATION
Browse files Browse the repository at this point in the history
  • Loading branch information
hopecee authored Jan 18, 2018
1 parent b38fd46 commit 11d6b58
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,10 @@ else if ("contains".equals(operation)) {
if (args.get(0) instanceof Literal) {
Literal literalValue = (Literal) args.get(0);
Neo4jLiteral neo4jLiteral = new Neo4jLiteral(literalValue.getLiteral());
Operator OP_CONTAINS = new Operator("=~", 6);
Neo4jExpression neo4jExpr = new Neo4jBooleanExpression(invokedFieldExpr, neo4jLiteral, OP_CONTAINS);
String propName = invokedFieldExpr.getFieldName();
String value = literalValue.getLiteral().toString();
String cypherText = propName + " =~ '(?i).*" + value + ".*'";
Neo4jExpression neo4jExpr = new Neo4jBooleanExpression(cypherText);
stack.push(neo4jExpr);
return neo4jExpr;
} else {
Expand Down

0 comments on commit 11d6b58

Please sign in to comment.