mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#594 - ElasticSearch - multi match support
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user