#304 - ElasticSearch integration part 1 / doc store integration

This commit is contained in:
Robin Bygrave
2016-03-01 15:36:44 +13:00
parent cb1fe297d6
commit 8d3b4a0407
209 changed files with 6736 additions and 573 deletions
@@ -4,6 +4,8 @@ import com.avaje.ebeaninternal.api.HashQueryPlanBuilder;
import com.avaje.ebeaninternal.api.SpiExpression;
import com.avaje.ebeaninternal.api.SpiExpressionRequest;
import java.io.IOException;
/**
* Generally speaking tests the value at a given path in the JSON document.
* <p>
@@ -57,6 +59,17 @@ class JsonPathExpression extends AbstractExpression {
this.upperValue = upperValue;
}
@Override
public void writeElastic(ElasticExpressionContext context) throws IOException {
String fullName = propName + "." + path;
if (operator == Op.BETWEEN) {
context.writeRange(fullName, Op.GT_EQ, value, Op.LT_EQ, upperValue);
} else {
context.writeSimple(operator, fullName, value);
}
}
@Override
public void queryPlanHash(HashQueryPlanBuilder builder) {
builder.add(JsonPathExpression.class).add(propName).add(path).add(operator);