#594 - ElasticSearch - multi match support

This commit is contained in:
Robin Bygrave
2016-03-09 23:44:23 +13:00
parent 34dcc98908
commit faf7df1c69
12 changed files with 524 additions and 95 deletions
@@ -2,6 +2,7 @@ package com.avaje.ebean;
import com.avaje.ebean.search.Match;
import com.avaje.ebean.search.MultiMatch;
import com.avaje.tests.model.basic.Order;
import org.junit.Test;
@@ -59,4 +60,21 @@ public class TextExpressionListTest {
}
@Test
public void syntax_multiMatch() {
Ebean.find(Order.class)
.text()
.multiMatch("Will Smith", "title", "*name");
MultiMatch match = MultiMatch.fields("title", "*name")
.opAnd()
.type(MultiMatch.Type.PHRASE_PREFIX);
Ebean.find(Order.class)
.text()
.multiMatch("Will Smith", match);
}
}