#594 - ElasticSearch - multi match support

This commit is contained in:
Robin Bygrave committed 2016-03-09 23:44:23 +13:00
1 parent 34dcc98908
commit faf7df1c69
12 files changed
+524 -95

No files matched your search

@@ -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);
}
}