mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-07 00:35:17 +00:00
#594 - ElasticSearch - multi match support
This commit is contained in:
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);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user